//**************************************************************************** // Copyright (c) 2005, Coveo Solutions Inc. //**************************************************************************** //**************************************************************************** // Shortcut for document.getElementById(...). //**************************************************************************** function G(p_Id) { return document.getElementById(p_Id); } //**************************************************************************** // Returns whether the current browser is Internet Explorer. //**************************************************************************** function CNL_IsIE() { return navigator.userAgent.indexOf('MSIE') != -1; } //**************************************************************************** // Returns whether the browser is in standard mode. //**************************************************************************** function CNL_IsStandard() { // I tested those with IE, FireFox and Opera. return document.compatMode != 'BackCompat' && document.compatMode != 'QuirksMode'; } //**************************************************************************** // Adds an event handler to an object. // p_Target - The object tag fires the event. // p_Event - The name of the event. // p_Handler - The event handler to register. //**************************************************************************** function CNL_WireEvent(p_Target, p_Event, p_Handler) { if (CNL_IsIE()) { p_Target.attachEvent(p_Event, p_Handler); } else { // addEventLister takes an event type that is usually the name of the // event with the 'on' at the start removed. if (p_Event.substring(0, 2) != 'on') { throw "Unknown event type: " + p_Event; } var name = p_Event.substring(2, p_Event.length); p_Target.addEventListener(name, p_Handler, false); } } //**************************************************************************** // Stops the propagation of an event. // p_Event - The event whose propagation to stop. //**************************************************************************** function CNL_StopPropagation(p_Event) { if (CNL_IsIE()) { p_Event.cancelBubble = true; } else { p_Event.stopPropagation(); } } //**************************************************************************** // Cancels an event (prevents it from bubbling up, and disable the default action). // p_Event - The event to cancel. //**************************************************************************** function CNL_CancelEvent(p_Event) { if (CNL_IsIE()) { p_Event.cancelBubble = true; p_Event.returnValue = false; } else { p_Event.stopPropagation(); p_Event.preventDefault(); } } //**************************************************************************** // Returns a new XMLHttpRequest object. //**************************************************************************** function CNL_CreateXmlHttpRequest() { var req; if (CNL_IsIE()) { req = new ActiveXObject("Microsoft.XMLHTTP"); } else { req = new XMLHttpRequest(); } return req; } //**************************************************************************** // Parses a string as xml and returns the xml dom object. // p_Xml - The xml to parse. // Returns the DOM object. //**************************************************************************** function CNL_ParseStringAsXml(p_Xml) { var dom; if (CNL_IsIE()) { dom = new ActiveXObject("Microsoft.XMLDOM"); dom.loadXML(p_Xml); } else { var parser = new DOMParser(); dom = parser.parseFromString(p_Xml, 'text/xml'); } return dom; } //**************************************************************************** // Performs a SelectNodes in a cross-browser compatible way. // p_Node - The node on which to perform the operation. // p_XPath - The xpath expression to use. // Returns the matching nodes. //**************************************************************************** function CNL_SelectNodes(p_Node, p_XPath) { var nodes; if (CNL_IsIE()) { nodes = p_Node.selectNodes(p_XPath); } else { var doc = p_Node.ownerDocument ? p_Node.ownerDocument : p_Node; var resolver = doc.createNSResolver(doc); var results = doc.evaluate(p_XPath, p_Node, resolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); nodes = new Array(); for (var i = 0; i < results.snapshotLength; ++i) { nodes.push(results.snapshotItem(i)); } } return nodes; } //**************************************************************************** // Performs a SelectSingleNode in a cross-browser compatible way. // p_Node - The node on which to perform the operation. // p_XPath - The xpath expression to use. // Returns the first matching node, if any, and null otherwise. //**************************************************************************** function CNL_SelectSingleNode(p_Node, p_XPath) { var node; if (CNL_IsIE()) { node = p_Node.selectSingleNode(p_XPath); } else { var nodes = CNL_SelectNodes(p_Node, p_XPath); node = nodes.length != 0 ? nodes[0] : null; } return node; } //**************************************************************************** // Returns the text content of an xml node. //**************************************************************************** function CNL_GetTextContent(p_Node) { return CNL_IsIE() ? p_Node.text : p_Node.textContent; } //**************************************************************************** // Converts an RGB value to a color string. // p_Red - The Red component. // p_Green - The Green component. // p_Blue - The Blue component. // Returns The color as a string (in the #xxxxxx format). //**************************************************************************** function CNL_RGBToString(p_Red, p_Green, p_Blue) { var r = p_Red.toString(16); if (r.length == 1) { r = '0' + r; } var g = p_Green.toString(16); if (g.length == 1) { g = '0' + g; } var b = p_Blue.toString(16); if (b.length == 1) { b = '0' + b; } return ('#' + r + g + b).toUpperCase(); } //**************************************************************************** // Sets the absolute position of an object, relative to the document. // p_Object - The object whose position should be set. // p_X - The X offset from the left of the document. // p_Y - The Y offset from the top of the document. //**************************************************************************** function CNL_SetPosition(p_Object, p_X, p_Y) { p_Object.style.left = p_X + 'px'; p_Object.style.top = p_Y + 'px'; } //**************************************************************************** // Retrieves the absolute position of an HTML object (in pixels) from the top of the document. // p_Object - The object whose position to retrieve. // Returns an object that contains the information. //**************************************************************************** function CNL_GetPosition(p_Object) { var pos = new Object(); pos.m_Left = 0; pos.m_Top = 0; var obj = p_Object; while (obj != null) { pos.m_Left += obj.offsetLeft - obj.scrollLeft; pos.m_Top += obj.offsetTop - obj.scrollTop; obj = obj.offsetParent; } return pos; } //**************************************************************************** // Retrieves the size of an HTML object (in pixels). // p_Object - The object whose size to retrieve. // Returns An object that contains the information. //**************************************************************************** function CNL_GetSize(p_Object) { var size = new Object(); size.m_Width = p_Object.offsetWidth; size.m_Height = p_Object.offsetHeight; return size; } //**************************************************************************** // Sets the size of an object. // p_Object - The object whose size should be set. // p_Width - The width to set. // p_Height - The height to set. //**************************************************************************** function CNL_SetSize(p_Object, p_Width, p_Height) { p_Object.style.width = p_Width + 'px'; p_Object.style.height = p_Height + 'px'; } //**************************************************************************** // Retrieves the bounding rectangle of an HTML object (in pixels). // p_Object - The object whose bounding rectangle to retrieve. // Returns An object that contains the information. //**************************************************************************** function CNL_GetBoundingRectangle(p_Object) { var pos = CNL_GetPosition(p_Object); var size = CNL_GetSize(p_Object); var rect = new Object(); rect.m_Left = pos.m_Left; rect.m_Top = pos.m_Top; rect.m_Right = pos.m_Left + size.m_Width; rect.m_Bottom = pos.m_Top + size.m_Height; return rect; } //**************************************************************************** // Retrieves the bounding of the region that is visible in the window (in pixels). // Returns An object that contains the information. //**************************************************************************** function CNL_GetVisibleRectangle() { var rect = new Object(); if (CNL_IsStandard()) { rect.m_Left = document.documentElement.scrollLeft; rect.m_Top = document.documentElement.scrollTop; rect.m_Right = rect.m_Left + document.documentElement.clientWidth; rect.m_Bottom = rect.m_Top + document.documentElement.clientHeight; } else { rect.m_Left = document.body.scrollLeft; rect.m_Top = document.body.scrollTop; rect.m_Right = rect.m_Left + document.body.clientWidth; rect.m_Bottom = rect.m_Top + document.body.clientHeight; } rect.m_Width = rect.m_Right - rect.m_Left; rect.m_Height = rect.m_Bottom - rect.m_Top; return rect; } //**************************************************************************** // Checks if a point is within a rectangle. // p_X - The X coordinate. // p_Y - The Y coordinate. // p_Rect - The rectangle. // Returns Whether the point is within the rectangle. //**************************************************************************** function CNL_IsWithin(p_X, p_Y, p_Rect) { return p_X >= p_Rect.m_Left && p_X < p_Rect.m_Right && p_Y >= p_Rect.m_Top && p_Y < p_Rect.m_Bottom; } //**************************************************************************** // Checks if a rectangle is within another rectangle. // p_Inside - The rectangle that should be inside. // p_Outside - The rectangle that should contain p_Inside. // Returns Whether the first rectangle is within the second one. //**************************************************************************** function CNL_IsRectangleWithin(p_Inside, p_Outside) { return CNL_IsWithin(p_Inside.m_Left, p_Inside.m_Top, p_Outside) && CNL_IsWithin(p_Inside.m_Right, p_Inside.m_Top, p_Outside) && CNL_IsWithin(p_Inside.m_Left, p_Inside.m_Bottom, p_Outside) && CNL_IsWithin(p_Inside.m_Right, p_Inside.m_Bottom, p_Outside); } //**************************************************************************** // Checks if two rectangles overlap. // p_Rect1 - The first rectangle. // p_Rect2 - The second rectangle. // Returns Whether the two rectangles overlap. //**************************************************************************** function CNL_IsOverlap(p_Rect1, p_Rect2) { // Look for an horizontal overlap var horiz = (p_Rect1.m_Left >= p_Rect2.m_Left && p_Rect1.m_Left < p_Rect2.m_Right) || (p_Rect1.m_Right > p_Rect2.m_Left && p_Rect1.m_Right < p_Rect2.m_Right) || (p_Rect2.m_Left >= p_Rect1.m_Left && p_Rect2.m_Left < p_Rect1.m_Right) || (p_Rect2.m_Right > p_Rect1.m_Left && p_Rect2.m_Right < p_Rect1.m_Right); // Look for a vertical overlap var vert = (p_Rect1.m_Top >= p_Rect2.m_Top && p_Rect1.m_Top < p_Rect2.m_Bottom) || (p_Rect1.m_Bottom > p_Rect2.m_Top && p_Rect1.m_Bottom < p_Rect2.m_Bottom) || (p_Rect2.m_Top >= p_Rect1.m_Top && p_Rect2.m_Top < p_Rect1.m_Bottom) || (p_Rect2.m_Bottom > p_Rect1.m_Top && p_Rect2.m_Bottom < p_Rect1.m_Bottom); return horiz && vert; } //**************************************************************************** // Positions an object relative to another. // p_Object - The object to position. // p_Reference - The object to position relatively to. // p_Position - Where to place the object from the other. //**************************************************************************** function CNL_PositionObject(p_Object, p_Reference, p_Position) { // Determine the default major and minor positions var position1; var position2; if (p_Position == 'LeftBelow') { position1 = 'Left'; position2 = 'Below'; } else if (p_Position == 'LeftAbove') { position1 = 'Left'; position2 = 'Above'; } else if (p_Position == 'AboveLeft') { position1 = 'Above'; position2 = 'Left'; } else if (p_Position == 'AboveRight') { position1 = 'Above'; position2 = 'Right'; } else if (p_Position == 'RightBelow') { position1 = 'Right'; position2 = 'Below'; } else if (p_Position == 'RightAbove') { position1 = 'Right'; position2 = 'Above'; } else if (p_Position == 'BelowLeft') { position1 = 'Below'; position2 = 'Left'; } else if (p_Position == 'BelowRight') { position1 = 'Below'; position2 = 'Right'; } else { throw 'Invalid value for p_Position'; } var left; var top; var done = false; var attempts = 0; var osize = CNL_GetSize(p_Object); var rrect = CNL_GetBoundingRectangle(p_Reference); var vrect = CNL_GetVisibleRectangle(); // Try 3 times to position the object. Globally speaking, when first iteration // fails, the invert position on all bad levels will be tried. If this position // is bad too, we want to allow another iteration to revert positions to the // initial ones (which are better when everything is bad). while (!done && attempts < 3) { // Position the object using the two indicators if (position1 == 'Left') { left = rrect.m_Left - osize.m_Width; } else if (position1 == 'Right') { left = rrect.m_Right - 1; } else if (position1 == 'Above') { top = rrect.m_Top - osize.m_Height; } else if (position1 == 'Below') { top = rrect.m_Bottom - 1; } if (position2 == 'Left') { left = rrect.m_Left; } else if (position2 == 'Right') { left = rrect.m_Right - osize.m_Width; } else if (position2 == 'Above') { top = rrect.m_Bottom - osize.m_Height; } else if (position2 == 'Below') { top = rrect.m_Top; } // Invert major and/or minor positions when needed done = true; var right = left + osize.m_Width; var bottom = top + osize.m_Height; if (left < vrect.m_Left || right >= vrect.m_Right) { if (position1 == 'Left') { position1 = 'Right'; } else if (position1 == 'Right') { position1 = 'Left' } else if (position2 == 'Left') { position2 = 'Right' } else if (position2 == 'Right') { position2 = 'Left' } done = false; } if (top < vrect.m_Top || bottom >= vrect.m_Bottom) { if (position1 == 'Above') { position1 = 'Below'; } else if (position1 == 'Below') { position1 = 'Above' } else if (position2 == 'Above') { position2 = 'Below' } else if (position2 == 'Below') { position2 = 'Above' } done = false; } ++attempts; } CNL_SetPosition(p_Object, left, top); } //**************************************************************************** // Fits the width of an element to the client width of it's parent. // p_Element - The element whose width to set. // Works only under IE! //**************************************************************************** function CNL_FitToParentWidth(p_Element) { var borderWidth = parseInt(p_Element.currentStyle.borderLeftWidth) + parseInt(p_Element.currentStyle.borderRightWidth); var paddingWidth = parseInt(p_Element.currentStyle.paddingLeft) + parseInt(p_Element.currentStyle.paddingRight); var available = p_Element.parentElement.scrollWidth - parseInt(p_Element.parentElement.currentStyle.paddingLeft) - parseInt(p_Element.parentElement.currentStyle.paddingRight); p_Element.style.pixelWidth = available - borderWidth - paddingWidth; } //**************************************************************************** // Resizes an iframe to it's content. // p_IFrame - The iframe to resize. //**************************************************************************** function CNL_ResizeIFrame(p_IFrame) { var width = p_IFrame.contentWindow.document.documentElement.scrollWidth; var height = p_IFrame.contentWindow.document.documentElement.scrollHeight; CNL_SetSize(p_IFrame, width, height); } //**************************************************************************** // Sets the opacity of an object. // p_Object - The object whose opacity should be set. // p_Opacity - The opacity to set (from 0 to 1). //**************************************************************************** function CNL_SetOpacity(p_Object, p_Opacity) { if (p_Opacity != 1) { if (CNL_IsIE()) { p_Object.style.filter = 'alpha(opacity=' + p_Opacity * 100 + ')'; } else { p_Object.style.opacity = p_Opacity; } } else { if (CNL_IsIE()) { p_Object.style.filter = ''; } else { p_Object.style.opacity = ''; } } } //**************************************************************************** // Retrieves the position of a mouse click relative to an object. // p_Event - The event object. // p_Reference - The reference element to use to size the iframe. //**************************************************************************** function CNL_GetMouseClickPosition(p_Event, p_Reference) { var rpos = CNL_GetPosition(p_Reference); // First compute the click offset from the page var px, py; if (CNL_IsIE()) { // IE provides the offset from the clicked object. var tpos = CNL_GetPosition(p_Event.srcElement); px = tpos.m_Left + p_Event.offsetX; py = tpos.m_Top + p_Event.offsetY; } else { // FireFox provides the offset from the page px = p_Event.pageX; py = p_Event.pageY; } // Then compute the offset from the reference var rpos = CNL_GetPosition(p_Reference); var pos = new Object(); pos.m_Left = px - rpos.m_Left; pos.m_Top = py - rpos.m_Top; return pos; } //**************************************************************************** // Sets the selected range of characters in a textbox. // p_TextBox - The textbox. // p_First - Index of the first character. // p_Last - Index of the character after the last one. //**************************************************************************** function CNL_SetSelectedRange(p_TextBox, p_First, p_Last) { if (CNL_IsIE()) { var range = p_TextBox.createTextRange(); range.moveStart('character', p_First); range.moveEnd('character', p_Last - p_TextBox.value.length); range.select(); } else { p_TextBox.setSelectionRange(p_First, p_Last); } } //**************************************************************************** // Copyright (c) 2006, Coveo Solutions Inc. //**************************************************************************** // This file defines augments the prototypes of various objects with useful // functions and also tries to make browsers a little more homogenous. //**************************************************************************** // Trims the content of a string. // Returns the trimmed string. //**************************************************************************** String.prototype.trim = function() { return this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""); } if (!CNL_IsIE()) { //************************************************************************ // Gets/sets the text inside a tag. //************************************************************************ HTMLElement.prototype.__defineGetter__("innerText", function() { return this.textContent; }); HTMLElement.prototype.__defineSetter__("innerText", function(p_Text) { this.textContent = p_Text; }); } //**************************************************************************** // Copyright (c) 2005, Coveo Solutions Inc. //**************************************************************************** function CNL_BaseDropDown() { //**************************************************************************** // Hints the control that the dropdown may soon be shown, and that any preparation // code that must be executed prior to it may begin to execute. //**************************************************************************** this.HintDropDownPrepare = function() { if (this.m_PrepareCode != '' && !this.m_Ready && !this.m_Preparing) { this.m_Preparing = true; eval(this.m_PrepareCode); } } //**************************************************************************** // Indicates that the dropdown is ready to be shown. //**************************************************************************** this.DropDownIsReady = function() { this.m_Preparing = false; this.m_Ready = true; // If we're supposed to be visible but that we aren't, show the dropdown now. if (this.m_Show && !this.IsDropDownVisible()) { this._DisplayDropDown(); } } //**************************************************************************** // Shows the dropdown box. //**************************************************************************** this.ShowDropDown = function() { this.m_Show = true; // If the dropdown is async and that it isn't ready, the DropIsReady method // will automatically show it when it is called. Otherwise, show it now. if (this.m_PrepareCode != '') { if (this.m_Ready) { this._DisplayDropDown(); } else if (!this.m_Preparing) { this.HintDropDownPrepare(); } } else { this._DisplayDropDown(); } } //**************************************************************************** // Hides the dropdown box. //**************************************************************************** this.HideDropDown = function() { document.getElementById(this.m_DropDownId).style.display = 'none'; this.m_Show = false; } //**************************************************************************** // Returns whether the dropdown should be visible or not. //**************************************************************************** this.IsDropDownVisible = function() { return this.m_Show; } //**************************************************************************** // Really shows the dropdown, when it is ready. //**************************************************************************** this._DisplayDropDown = function() { var dropDown = document.getElementById(this.m_DropDownId); dropDown.style.display = ''; var size = CNL_GetSize(dropDown); if (size.m_Width > 5 && size.m_Height > 5) { CNL_PositionObject(dropDown, this, this.m_Position); } else { dropDown.style.display = 'none'; } } } // Constructor //**************************************************************************** // Copyright (c) 2005, Coveo Solutions Inc. //**************************************************************************** function CNL_CustomDropDown() { var m_IsMouseOver = false; //**************************************************************************** // Event handler for the onmouseover event of the dropdown. //**************************************************************************** this.OnMouseOver = function() { if (!this.m_IsMouseOver) { if (!this.IsDropDownVisible()) { if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) { Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer(); } } if (this.m_BorderOnHover) { this.style.borderColor = this.m_BorderColor; } if (this.m_ArrowOnHover) { document.getElementById(this.m_ArrowId).style.visibility = 'visible'; } } this.m_IsMouseOver = true; } //**************************************************************************** // Event handler for the onmouseoout event of the dropdown. //**************************************************************************** this.OnMouseOut = function() { if (this.m_IsMouseOver) { this.m_IsMouseOver = false; this.OnMouseOutBehaviour(); } } //**************************************************************************** // Behaviour of the OnMouseOut event of the dropdown. // It is extracted from the event handler because the method // HideAndRestoreHandler use it. //**************************************************************************** this.OnMouseOutBehaviour = function() { if ((!this.m_IsMouseOver) && (!this.IsDropDownVisible())) { if (document.getElementById(this.m_DropDownId).style.visibility != 'visible') { if (this.m_BorderOnHover) { this.style.borderColor = this.m_BackColor; } if (this.m_ArrowOnHover) { document.getElementById(this.m_ArrowId).style.visibility = 'hidden'; } } if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) { Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer(); } } } //**************************************************************************** // Event handler for the onclick event of the dropdown button. //**************************************************************************** this.Arrow_OnClick = function(p_Event) { if (!this.IsDropDownVisible()) { var size = CNL_GetSize(this); CNL_SetSize(document.getElementById(this.m_DropDownId), size.m_Width, size.m_Height); this.ShowDropDown(); // Fire any old handler, so that any other dropdown on the page may // properly close itself before this one opens. if (document.onclick) { document.onclick(p_Event); } this.m_OldClickHandler = document.onclick; this.m_OldKeyPressHandler = document.onkeypress; var myself = this; if (CNL_IsIE()) { document.onclick = function() { myself.Document_OnClick(event); }; document.onkeypress = function() { myself.Document_OnKeyPress(event); }; } else { document.onclick = function(event) { myself.Document_OnClick(event); }; document.onkeydown = function(event) { myself.Document_OnKeyPress(event); }; } } else { this.HideAndRestoreHandler(); } CNL_StopPropagation(p_Event); } //**************************************************************************** // Event handler for the onclick event of the document. //**************************************************************************** this.Document_OnClick = function(p_Event) { if (this.m_HideOnClick || !CNL_IsWithin(p_Event.clientX, p_Event.clientY, CNL_GetBoundingRectangle(document.getElementById(this.m_DropDownId)))) { this.HideAndRestoreHandler(); } } //**************************************************************************** // Event handler for the onkeypress event. //**************************************************************************** this.Document_OnKeyPress = function(p_Event) { if (CNL_IsIE()) { if (p_Event.keyCode == 27) { this.HideAndRestoreHandler(); } } else { if (p_Event.which == 27) { this.HideAndRestoreHandler(); } } } //**************************************************************************** // Hides the dropdown and restore the old event handler. //**************************************************************************** this.HideAndRestoreHandler = function() { if (this.IsDropDownVisible()) { this.HideDropDown(); document.onclick = this.m_OldClickHandler; if (CNL_IsIE()) { document.onkeypress = this.m_OldKeyPressHandler; } else { document.onkeydown = this.m_OldKeyPressHandler; } this.OnMouseOutBehaviour(); } } } // Constructor // Script# Browser Compat Layer // More information at http://projects.nikhilk.net/ScriptSharp // function __loadCompatLayer(w){w.Debug=function(){};w.Debug._fail=function(message){throw new Error(message);};w.Debug.writeln=function(text){if(window.console){if(window.console.debug){window.console.debug(text);return;} else if(window.console.log){window.console.log(text);return;}} else if(window.opera&&window.opera.postError){window.opera.postError(text);return;}};w.__getNonTextNode=function(node){try{while(node&&(node.nodeType!=1)){node=node.parentNode;}} catch(ex){node=null;} return node;};w.__getLocation=function(e){var loc={x:0,y:0};while(e){loc.x+=e.offsetLeft;loc.y+=e.offsetTop;e=e.offsetParent;} return loc;};w.navigate=function(url){window.setTimeout('window.location = "'+url+'";',0);};var attachEventProxy=function(eventName,eventHandler){eventHandler._mozillaEventHandler=function(e){window.event=e;eventHandler();if(!e.avoidReturn){return e.returnValue;}};this.addEventListener(eventName.slice(2),eventHandler._mozillaEventHandler,false);};var detachEventProxy=function(eventName,eventHandler){if(eventHandler._mozillaEventHandler){var mozillaEventHandler=eventHandler._mozillaEventHandler;delete eventHandler._mozillaEventHandler;this.removeEventListener(eventName.slice(2),mozillaEventHandler,false);}};w.attachEvent=attachEventProxy;w.detachEvent=detachEventProxy;w.HTMLDocument.prototype.attachEvent=attachEventProxy;w.HTMLDocument.prototype.detachEvent=detachEventProxy;w.HTMLElement.prototype.attachEvent=attachEventProxy;w.HTMLElement.prototype.detachEvent=detachEventProxy;w.Event.prototype.__defineGetter__('srcElement',function(){return __getNonTextNode(this.target)||this.currentTarget;});w.Event.prototype.__defineGetter__('cancelBubble',function(){return this._bubblingCanceled||false;});w.Event.prototype.__defineSetter__('cancelBubble',function(v){if(v){this._bubblingCanceled=true;this.stopPropagation();}});w.Event.prototype.__defineGetter__('returnValue',function(){return!this._cancelDefault;});w.Event.prototype.__defineSetter__('returnValue',function(v){if(!v){this._cancelDefault=true;this.preventDefault();}});w.Event.prototype.__defineGetter__('fromElement',function(){var n;if(this.type=='mouseover'){n=this.relatedTarget;} else if(this.type=='mouseout'){n=this.target;} return __getNonTextNode(n);});w.Event.prototype.__defineGetter__('toElement',function(){var n;if(this.type=='mouseout'){n=this.relatedTarget;} else if(this.type=='mouseover'){n=this.target;} return __getNonTextNode(n);});w.Event.prototype.__defineGetter__('button',function(){return(this.which==1)?1:(this.which==3)?2:0});w.Event.prototype.__defineGetter__('offsetX',function(){return window.pageXOffset+this.clientX-__getLocation(this.srcElement).x;});w.Event.prototype.__defineGetter__('offsetY',function(){return window.pageYOffset+this.clientY-__getLocation(this.srcElement).y;});w.HTMLElement.prototype.__defineGetter__('parentElement',function(){return this.parentNode;});w.HTMLElement.prototype.__defineGetter__('children',function(){var children=[];var childCount=this.childNodes.length;for(var i=0;i=0)||(ua.indexOf('AppleWebKit')>=0)||(ua.indexOf('Opera')>=0);} if(__supportsCompatLayer(window.navigator.userAgent)){try{__loadCompatLayer(window);} catch(e){}}// Script# Silverlight Bootstrapper // More information at http://projects.nikhilk.net/ScriptSharp // function _SL(){var ua=window.navigator.userAgent;if((ua.indexOf('MSIE')>=0)||(ua.indexOf('Firefox')>=0)||(ua.indexOf('Safari')>=0)){this.isSupported=true;} else{this._version='';} window.attachEvent('onunload',_SL.cleanup);} _SL.count=0;_SL.cleanup=function(){for(var i=_SL.count-1;i>=0;i--){window['__slLoad'+i]=null;window['__slError'+i]=null;window['__slProgress'+i]=null;} window.detachEvent('onunload',_SL.cleanup);} _SL.createHandler=function(callback){return function(sender,e){callback(sender,e)};} _SL.createLoadHandler=function(callback,element,context){return function(){window.setTimeout(function(){callback(element.childNodes[0],context);},0);};} _SL.prototype={isSupported:false,_version:null,_getVersion:function(){if(this._version!==null){return this._version;} this._version='';var container=null;try{var control=null;if(window.ActiveXObject){control=new ActiveXObject('AgControl.AgControl');} else{if(navigator.plugins['Silverlight Plug-In']){container=document.createElement('div');document.body.appendChild(container);container.innerHTML='';control=container.childNodes[0];}} if(control){var versionParts=[0,0,0,0];for(var i=0;icheckParts[0]){return true;} else if(existingVersion[0]==checkParts[0]){if(existingVersion[1]>=checkParts[1]){return true;}} return false;},createInstallPrompt:function(element,version,installPromptImage,useNewWindow){element.innerHTML='';},createParams:function(source,parentElement,id,className){return{source:source,parentElement:parentElement,id:id,className:className,version:'1.0'};},createInstance:function(params,loadCallback,context){if(!this.isSupported){return null;} var version=params.version;var parentElement=params.parentElement;if(!this.isInstalled(version)){if(params.alternateContent){parentElement.innerHTML=params.alternateContent;} else if(!params.suppressInstallPrompt){this.createInstallPrompt(parentElement,version,params.installPromptImage,params.installInNewWindow);} return null;} var count=_SL.count++;if(!params.source||params.xaml){var xaml=params.xaml||'';var scriptElement=document.createElement('script');scriptElement.type='text/xaml';scriptElement.text=xaml;scriptElement.id='__slXaml'+count;document.body.appendChild(scriptElement);params.source='#__slXaml'+count;delete params.xaml;} if(params.startupArguments){var initParams=[];for(var arg in params.startupArguments){initParams.push(arg);initParams.push('=');initParams.push(params.startupArguments[arg]);initParams.push(',');} params.initParams=initParams.join('');delete params.startupArguments;} var id=params.id||'__sl'+count;var className=params.className||'';var style=params.style||'';if(loadCallback){params.onLoad='__slLoad'+count;window[params.onLoad]=_SL.createLoadHandler(loadCallback,parentElement,context);} if(params.progressCallback){params.onSourceDownloadProgressChanged='__slProgress'+count;window[params.onSourceDownloadProgressChanged]=_SL.createHandler(params.progressCallback);delete params.progressCallback;} params.onError='__slError'+count;if(params.errorCallback){window[params.onError]=_SL.createHandler(params.errorCallback);delete params.errorCallback;} delete params.id;delete params.className;delete params.style;delete params.parentElement;delete params.version;delete params.installPromptImage;delete params.installUsesNewWindow;delete params.suppressInstallPrompt;delete params.alternateContent;var html=[''];for(var name in params){html.push('');} html.push('');parentElement.innerHTML=html.join('');return parentElement.childNodes[0];}};var SilverlightPlugin=new _SL();// Script# Core Runtime // More information at http://projects.nikhilk.net/ScriptSharp // window.isUndefined=function(o){return(o===undefined);};window.isNull=function(o){return(o===null);};window.isNullOrUndefined=function(o){return(o===null)||(o===undefined);};window.__scriptsharp='0.5.5.0';document.getElementsBySelector=function(cssSelector,root){var all=root?root.getElementsByTagName('*'):document.getElementsByTagName('*');var matches=[];var styleSheet=document.getElementsBySelector.styleSheet;if(!styleSheet){var styleSheetNode=document.createElement('style');styleSheetNode.type='text/css';document.getElementsByTagName('head')[0].appendChild(styleSheetNode);styleSheet=styleSheetNode.styleSheet||styleSheetNode.sheet;document.getElementsBySelector.styleSheet=styleSheet;} if(window.navigator.userAgent.indexOf('MSIE')>=0){styleSheet.addRule(cssSelector,'ssCssMatch:true',0);for(var i=all.length-1;i>=0;i--){var element=all[i];if(element.currentStyle.ssCssMatch){matches[matches.length]=element;}} styleSheet.removeRule(0);} else{var matchValue=document.getElementsBySelector.matchValue;if(!matchValue){matchValue=(window.navigator.userAgent.indexOf('Opera')>=0)?'"ssCssMatch"':'ssCssMatch 1';document.getElementsBySelector.matchValue=matchValue;} styleSheet.insertRule(cssSelector+' { counter-increment: ssCssMatch }',0);var docView=document.defaultView;for(var i=all.length-1;i>=0;i--){var element=all[i];if(docView.getComputedStyle(element,null).counterIncrement===matchValue){matches[matches.length]=element;}} styleSheet.deleteRule(0);} if(matches.length>1){matches.reverse();} return matches;} Object.__typeName='Object';Object.__baseType=null;Object.parse=function(s){return eval(s);} Object.getKeyCount=function(d){var count=0;for(var n in d){count++;} return count;} Object.clearKeys=function(d){for(var n in d){delete d[n];}} Object.keyExists=function(d,key){return d[key]!==undefined;} Function.parse=function(s){if(!Function._parseCache){Function._parseCache={};} var fn=Function._parseCache[s];if(!fn){try{eval('fn = '+s);if(typeof(fn)!='function'){fn=null;} else{Function._parseCache[s]=fn;}} catch(ex){}} return fn;} Function.prototype.invoke=function(){this.apply(null,arguments);} Boolean.__typeName='Boolean';Boolean.parse=function(s){return(s.toLowerCase()=='true');} Number.__typeName='Number';Number.parse=function(s){if(!s||!s.length){return 0;} if((s.indexOf('.')>=0)||(s.indexOf('e')>=0)||s.endsWith('f')||s.endsWith('F')){return parseFloat(s);} return parseInt(s);} Number.prototype.format=function(format,useLocale){if(isNullOrUndefined(format)||(format.length==0)||(format=='i')){if(useLocale){return this.toLocaleString();} else{return this.toString();}} return this._netFormat(format,useLocale);} Number._commaFormat=function(number,groups,decimal,comma){var decimalPart=null;var decimalIndex=number.indexOf(decimal);if(decimalIndex>0){decimalPart=number.substr(decimalIndex);number=number.substr(0,decimalIndex);} var negative=number.startsWith('-');if(negative){number=number.substr(1);} var groupIndex=0;var groupSize=groups[groupIndex];if(number.length1){precision=parseInt(format.substr(1));} var fs=format.charAt(0);switch(fs){case'd':case'D':s=parseInt(Math.abs(this)).toString();if(precision!=-1){s=s.padLeft(precision,'0');} if(this<0){s='-'+s;} break;case'x':case'X':s=parseInt(Math.abs(this)).toString(16);if(fs=='X'){s=s.toUpperCase();} if(precision!=-1){s=s.padLeft(precision,'0');} break;case'e':case'E':if(precision==-1){s=this.toExponential();} else{s=this.toExponential(precision);} if(fs=='E'){s=s.toUpperCase();} break;case'f':case'F':case'n':case'N':if(precision==-1){precision=nf.numberDecimalDigits;} s=this.toFixed(precision).toString();if(precision&&(nf.numberDecimalSeparator!='.')){var index=s.indexOf('.');s=s.substr(0,index)+nf.numberDecimalSeparator+s.substr(index+1);} if((fs=='n')||(fs=='N')){s=Number._commaFormat(s,nf.numberGroupSizes,nf.numberDecimalSeparator,nf.numberGroupSeparator);} break;case'c':case'C':if(precision==-1){precision=nf.currencyDecimalDigits;} s=Math.abs(this).toFixed(precision).toString();if(precision&&(nf.currencyDecimalSeparator!='.')){var index=s.indexOf('.');s=s.substr(0,index)+nf.currencyDecimalSeparator+s.substr(index+1);} s=Number._commaFormat(s,nf.currencyGroupSizes,nf.currencyDecimalSeparator,nf.currencyGroupSeparator);if(this<0){s=String.format(nf.currencyNegativePattern,s);} else{s=String.format(nf.currencyPositivePattern,s);} break;case'p':case'P':if(precision==-1){precision=nf.percentDecimalDigits;} s=(Math.abs(this)*100.0).toFixed(precision).toString();if(precision&&(nf.percentDecimalSeparator!='.')){var index=s.indexOf('.');s=s.substr(0,index)+nf.percentDecimalSeparator+s.substr(index+1);} s=Number._commaFormat(s,nf.percentGroupSizes,nf.percentDecimalSeparator,nf.percentGroupSeparator);if(this<0){s=String.format(nf.percentNegativePattern,s);} else{s=String.format(nf.percentPositivePattern,s);} break;} return s;} Math.truncate=function(n){return(n>=0)?Math.floor(n):Math.ceil(n);} String.__typeName='String';String.Empty='';String.compare=function(s1,s2,ignoreCase){if(ignoreCase){if(s1){s1=s1.toUpperCase();} if(s2){s2=s2.toUpperCase();}} s1=s1||'';s2=s2||'';if(s1==s2){return 0;} if(s1this.length){return false;} return(this.substr(this.length-suffix.length)==suffix);} String.equals=function(s1,s2,ignoreCase){return String.compare(s1,s2,ignoreCase)==0;} String._format=function(format,values,useLocale){if(!String._formatRE){String._formatRE=/(\{[^\}^\{]+\})/g;} return format.replace(String._formatRE,function(str,m){var index=parseInt(m.substr(1));var value=values[index+1];if(isNullOrUndefined(value)){return'';} if(value.format){var formatSpec=null;var formatIndex=m.indexOf(':');if(formatIndex>0){formatSpec=m.substring(formatIndex+1,m.length-1);} return value.format.call(value,formatSpec,useLocale);} else{if(useLocale){return value.toLocaleString();} return value.toString();}});} String.format=function(format){return String._format(format,arguments,false);} String.fromChar=function(ch,count){var s=ch;for(var i=1;i','"':'"'};String._htmlDecRE=/(&|<|>|")/gi;} var s=this;s=s.replace(String._htmlDecRE,function(str,m){return String._htmlDecMap[m];});return s;} String.prototype.htmlEncode=function(){if(!String._htmlEncRE){String._htmlEncMap={'&':'&','<':'<','>':'>','"':'"'};String._htmlEncRE=/([&<>"])/g;} var s=this;if(String._htmlEncRE.test(s)){s=s.replace(String._htmlEncRE,function(str,m){return String._htmlEncMap[m];});} return s;} String.prototype.indexOfAny=function(chars,startIndex,count){var length=this.length;if(!length){return-1;} startIndex=startIndex||0;count=count||length;var endIndex=startIndex+count-1;if(endIndex>=length){endIndex=length-1;} for(var i=startIndex;i<=endIndex;i++){if(chars.indexOf(this.charAt(i))>=0){return i;}} return-1;} String.prototype.insert=function(index,value){if(!value){return this;} if(!index){return value+this;} var s1=this.substr(0,index);var s2=this.substr(index);return s1+value+s2;} String.isNullOrEmpty=function(s){return!s||!s.length;} String.prototype.lastIndexOfAny=function(chars,startIndex,count){var length=this.length;if(!length){return-1;} startIndex=startIndex||length-1;count=count||length;var endIndex=startIndex-count+1;if(endIndex<0){endIndex=0;} for(var i=startIndex;i>=endIndex;i--){if(chars.indexOf(this.charAt(i))>=0){return i;}} return-1;} String.localeFormat=function(format){return String._format(format,arguments,true);} String.prototype.padLeft=function(totalWidth,ch){if(this.lengththis.length)){return this.substr(0,index);} return this.substr(0,index)+this.substr(index+count);} String.prototype._replace=String.prototype.replace;String.prototype.replace=function(oldValue,newValue){if(oldValue.constructor==String){newValue=newValue||'';return this.split(oldValue).join(newValue);} return String.prototype._replace.call(this,oldValue,newValue);} String.prototype.startsWith=function(prefix){if(!prefix.length){return true;} if(prefix.length>this.length){return false;} return(this.substr(0,prefix.length)==prefix);} String.prototype.trim=function(){return this.trimEnd().trimStart();} String.prototype.trimEnd=function(){return this.replace(/\s*$/,'');} String.prototype.trimStart=function(){return this.replace(/^\s*/,'');} String.prototype.unquote=function(){return eval('('+this+')');} Array.__typeName='Array';Array.prototype.add=function(item){this[this.length]=item;} Array.prototype.addRange=function(items){if(!items){return;} var length=items.length;for(var index=0;index0){this.splice(0,this.length);}} Array.prototype.clone=function(){var length=this.length;var array=new Array(length);for(var index=0;index=0);} Array.prototype.dequeue=function(){return this.shift();} Array.prototype.enqueue=function(item){this._queue=true;this.push(item);} Array.prototype.peek=function(){if(this.length){var index=this._queue?0:this.length-1;return this[index];} return null;} if(!Array.prototype.every){Array.prototype.every=function(callback){for(var i=this.length-1;i>=0;i--){if(!callback(this[i],i,this)){return false;}} return true;}} Array.prototype.extract=function(index,count){if(!count){return this.slice(index);} return this.slice(index,index+count);} if(!Array.prototype.filter){Array.prototype.filter=function(callback){var filtered=[];for(var i=0;i=0;i--){mapped[i]=callback(this[i],i,this);} return mapped;}} Array.parse=function(s){return eval('('+s+')');} Array.prototype.remove=function(item){var index=this.indexOf(item);if(index>=0){this.splice(index,1);return true;} return false;} Array.prototype.removeAt=function(index){return this.splice(index,1)[0];} Array.prototype.removeRange=function(index,count){return this.splice(index,count);} if(!Array.prototype.some){Array.prototype.some=function(callback){for(var i=this.length-1;i>=0;i--){if(callback(this[i],i,this)){return true;}} return false;}} RegExp.__typeName='RegExp';RegExp.parse=function(s){if(s.startsWith('/')){var endSlashIndex=s.lastIndexOf('/');if(endSlashIndex>1){var expression=s.substring(1,endSlashIndex);var flags=s.substr(endSlashIndex+1);return new RegExp(expression,flags);}} return null;} Date.__typeName='Date';Date.get_now=function(){return new Date();} Date.get_today=function(){var d=new Date();return new Date(d.getFullYear(),d.getMonth(),d.getDate());} Date.prototype.format=function(format,useLocale){if(isNullOrUndefined(format)||(format.length==0)||(format=='i')){if(useLocale){return this.toLocaleString();} else{return this.toString();}} if(format=='id'){if(useLocale){return this.toLocaleDateString();} else{return this.toDateString();}} if(format=='it'){if(useLocale){return this.toLocaleTimeString();} else{return this.toTimeString();}} return this._netFormat(format,useLocale);} Date.prototype._netFormat=function(format,useLocale){var dtf=useLocale?CultureInfo.Current.dateFormat:CultureInfo.Neutral.dateFormat;var useUTC=false;if(format.length==1){switch(format){case'f':format=dtf.longDatePattern+' '+dtf.shortTimePattern;case'F':format=dtf.dateTimePattern;break;case'd':format=dtf.shortDatePattern;break;case'D':format=dtf.longDatePattern;break;case't':format=dtf.shortTimePattern;break;case'T':format=dtf.longTimePattern;break;case'g':format=dtf.shortDatePattern+' '+dtf.shortTimePattern;break;case'G':format=dtf.shortDatePattern+' '+dtf.longTimePattern;break;case'R':case'r':format=dtf.gmtDateTimePattern;useUTC=true;break;case'u':format=dtf.universalDateTimePattern;useUTC=true;break;case'U':format=dtf.dateTimePattern;useUTC=true;break;case's':format=dtf.sortableDateTimePattern;break;}} if(format.charAt(0)=='%'){format=format.substr(1);} if(!Date._formatRE){Date._formatRE=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g;} var re=Date._formatRE;var sb=new StringBuilder();var dt=this;if(useUTC){dt=new Date(Date.UTC(dt.getUTCFullYear(),dt.getUTCMonth(),dt.getUTCDate(),dt.getUTCHours(),dt.getUTCMinutes(),dt.getUTCSeconds(),dt.getUTCMilliseconds()));} re.lastIndex=0;while(true){var index=re.lastIndex;var match=re.exec(format);sb.append(format.slice(index,match?match.index:format.length));if(!match){break;} var fs=match[0];var part=fs;switch(fs){case'dddd':part=dtf.dayNames[dt.getDay()];break;case'ddd':part=dtf.shortDayNames[dt.getDay()];break;case'dd':part=dt.getDate().toString().padLeft(2,'0');break;case'd':part=dt.getDate();break;case'MMMM':part=dtf.monthNames[dt.getMonth()];break;case'MMM':part=dtf.shortMonthNames[dt.getMonth()];break;case'MM':part=(dt.getMonth()+1).toString().padLeft(2,'0');break;case'M':part=(dt.getMonth()+1);break;case'yyyy':part=dt.getFullYear();break;case'yy':part=(dt.getFullYear()%100).toString().padLeft(2,'0');break;case'y':part=(dt.getFullYear()%100);break;case'h':case'hh':part=dt.getHours()%12;if(!part){part='12';} else if(fs=='hh'){part=part.toString().padLeft(2,'0');} break;case'HH':part=dt.getHours().toString().padLeft(2,'0');break;case'H':part=dt.getHours();break;case'mm':part=dt.getMinutes().toString().padLeft(2,'0');break;case'm':part=dt.getMinutes();break;case'ss':part=dt.getSeconds().toString().padLeft(2,'0');break;case's':part=dt.getSeconds();break;case't':case'tt':part=(dt.getHours()<12)?dtf.amDesignator:dtf.pmDesignator;if(fs=='t'){part=part.charAt(0);} break;case'fff':part=dt.getMilliseconds().toString().padLeft(3,'0');break;case'ff':part=dt.getMilliseconds().toString().padLeft(3).substr(0,2);break;case'f':part=dt.getMilliseconds().toString().padLeft(3).charAt(0);break;case'z':part=dt.getTimezoneOffset()/60;part=((part>=0)?'-':'+')+Math.floor(Math.abs(part));break;case'zz':case'zzz':part=dt.getTimezoneOffset()/60;part=((part>=0)?'-':'+')+Math.floor(Math.abs(part)).toString().padLeft(2,'0');if(fs=='zzz'){part+=dtf.timeSeparator+Math.abs(dt.getTimezoneOffset()%60).toString().padLeft(2,'0');} break;} sb.append(part);} return sb.toString();} Date._parse=Date.parse;Date.parse=function(s){return new Date(Date._parse(s));} Error.__typeName='Error';Error.create=function(message,userData,innerException){var e=new Error(message);if(userData){e.userData=userData;} if(innerException){e.innerException=innerException;} return e;} if(!Debug._fail){Debug._fail=function(message){Debug.writeln(message);eval('debugger;');}} Debug.assert=function(condition,message){if(!condition){message='Assert failed: '+message;if(confirm(message+'\r\n\r\nBreak into debugger?')){Debug._fail(message);}}} Debug._dumpCore=function(sb,object,name,indentation,dumpedObjects){if(object===null){sb.appendLine(indentation+name+': null');return;} switch(typeof(object)){case'undefined':sb.appendLine(indentation+name+': undefined');break;case'number':case'string':case'boolean':sb.appendLine(indentation+name+': '+object);break;default:if(Date.isInstance(object)||RegExp.isInstance(object)){sb.appendLine(indentation+name+': '+object);break;} if(dumpedObjects.contains(object)){sb.appendLine(indentation+name+': ...');break;} dumpedObjects.add(object);var type=Type.getInstanceType(object);var typeName=type.get_fullName();var recursiveIndentation=indentation+' ';if(IArray.isInstance(object)){sb.appendLine(indentation+name+': {'+typeName+'}');var length=object.getLength();for(var i=0;i');var attributes=object.attributes;for(var i=0;i0){return fullName.substr(nsIndex+1);} return fullName;} Type.prototype.isInstance=function(instance){if(isNullOrUndefined(instance)){return false;} if((this==Object)||(instance instanceof this)){return true;} var type=Type.getInstanceType(instance);return this.isAssignableFrom(type);} Type.prototype.isAssignableFrom=function(type){if((this==Object)||(this==type)){return true;} if(this.__class){var baseType=type.__baseType;while(baseType){if(this==baseType){return true;} baseType=baseType.__baseType;}} else if(this.__interface){var interfaces=type.__interfaces;if(interfaces&&interfaces.contains(this)){return true;} var baseType=type.__baseType;while(baseType){interfaces=baseType.__interfaces;if(interfaces&&interfaces.contains(this)){return true;} baseType=baseType.__baseType;}} return false;} Type.isClass=function(type){return(type.__class==true);} Type.isEnum=function(type){return(type.__enum==true);} Type.isFlagsEnum=function(type){return((type.__enum==true)&&(type.__flags==true));} Type.isInterface=function(type){return(type.__interface==true);} Type.canCast=function(instance,type){return type.isInstance(instance);} Type.safeCast=function(instance,type){if(type.isInstance(instance)){return instance;} return null;} Type.getInstanceType=function(instance){var ctor=null;try{ctor=instance.constructor;} catch(ex){} if(!ctor||!ctor.__typeName){ctor=Object;} return ctor;} Type.getType=function(typeName){if(!typeName){return null;} if(!Type.__typeCache){Type.__typeCache={};} var type=Type.__typeCache[typeName];if(!type){type=eval(typeName);Type.__typeCache[typeName]=type;} return type;} Type.parse=function(typeName){return Type.getType(typeName);} window.Enum=function(){} Enum.createClass('Enum');Enum.parse=function(enumType,s){var values=enumType.prototype;if(!enumType.__flags){for(var f in values){if(f===s){return values[f];}}} else{var parts=s.split('|');var value=0;var parsed=true;for(var i=parts.length-1;i>=0;i--){var part=parts[i].trim();var found=false;for(var f in values){if(f===part){value|=values[f];found=true;break;}} if(!found){parsed=false;break;}} if(parsed){return value;}} throw'Invalid Enumeration Value';} Enum.toString=function(enumType,value){var values=enumType.prototype;if(!enumType.__flags||(value===0)){for(var i in values){if(values[i]===value){return i;}} throw'Invalid Enumeration Value';} else{var parts=[];for(var i in values){if(values[i]&value){if(parts.length){parts.add(' | ');} parts.add(i);}} if(!parts.length){throw'Invalid Enumeration Value';} return parts.join('');}} window.Delegate=function(){} Delegate.createClass('Delegate');Delegate.Null=function(){} Delegate._create=function(targets){var delegate=function(){if(targets.length==2){return targets[1].apply(targets[0],arguments);} else{for(var i=0;i=0);this._onLoadHandler=Delegate.create(this,this._onScriptLoad);if(!this._isIE){this._onErrorHandler=Delegate.create(this,this._onScriptError);} this._scriptElements=[];if(loadInParallel){for(var i=0;i=0){this.$0=4;$1=$0.substr($2+6);}else if(($2=$0.indexOf('msie'))>=0){this.$0=1;$1=$0.substr($2+5);}else if(($2=$0.indexOf('safari'))>=0){this.$0=3;$1=$0.substr($2+7);}else if(($2=$0.indexOf('firefox'))>=0){this.$0=2;$1=$0.substr($2+8);}else if($0.indexOf('gecko')>=0){this.$0=2;$1=window.navigator.appVersion;}if($1!=null){this.$1=parseFloat($1);this.$2=parseInt(this.$1);if(($2=$1.indexOf('.'))>=0){this.$3=parseInt($1.substr($2+1));}}} ScriptFX.HostInfo.prototype={$0:0,$1:0,$2:0,$3:0,get_majorVersion:function(){return this.$2;},get_minorVersion:function(){return this.$3;},get_name:function(){return this.$0;},get_version:function(){return this.$1;}} ScriptFX.EventList=function(){} ScriptFX.EventList.prototype={$0:null,addHandler:function(key,handler){if(this.$0==null){this.$0={};}this.$0[key]=Delegate.combine(this.$0[key],handler);},getHandler:function(key){if(this.$0!=null){return this.$0[key];}return null;},removeHandler:function(key,handler){if(this.$0!=null){var $0=this.$0[key];if($0!=null){var $1=Delegate.remove($0,handler);this.$0[key]=$1;return ($1!=null);}}return false;}} ScriptFX.JSON=function(){} ScriptFX.JSON.deserialize=function(s){if(String.isNullOrEmpty(s)){return null;}if(ScriptFX.JSON.$0==null){ScriptFX.JSON.$0=new RegExp('(\'|\")\\\\@(-?[0-9]+)@(\'|\")','gm');}s=s.replace(ScriptFX.JSON.$0,'new Date($2)');return eval('('+s+')');} ScriptFX.JSON.serialize=function(o){if(isNullOrUndefined(o)){return String.Empty;}var $0=new StringBuilder();ScriptFX.JSON.$1($0,o);return $0.toString();} ScriptFX.JSON.$1=function($p0,$p1){if(isNullOrUndefined($p1)){$p0.append('null');return;}var $0=typeof($p1);switch($0){case 'boolean':$p0.append($p1.toString());return;case 'number':$p0.append((isFinite($p1))?$p1.toString():'null');return;case 'string':$p0.append(($p1).quote());return;case 'object':if(Array.isInstance($p1)){$p0.append('[');var $1=$p1;var $2=$1.length;var $3=true;for(var $4=0;$4<$2;$4++){if($3){$3=false;}else{$p0.append(',');}ScriptFX.JSON.$1($p0,$1[$4]);}$p0.append(']');}else if(Date.isInstance($p1)){var $5=$p1;var $6=Date.UTC($5.getUTCFullYear(),$5.getUTCMonth(),$5.getUTCDate(),$5.getUTCHours(),$5.getUTCMinutes(),$5.getUTCSeconds(),$5.getUTCMilliseconds());$p0.append('\"\\@');$p0.append($6.toString());$p0.append('@\"');}else if(RegExp.isInstance($p1)){$p0.append($p1.toString());}else{$p0.append('{');var $7=true;var $dict1=$p1;for(var $key2 in $dict1){var $8={key:$key2,value:$dict1[$key2]};if(($8.key).startsWith('$')||Function.isInstance($8.value)){continue;}if($7){$7=false;}else{$p0.append(',');}$p0.append($8.key);$p0.append(':');ScriptFX.JSON.$1($p0,$8.value);}$p0.append('}');}return;default:$p0.append('null');return;}} ScriptFX.PropertyChangedEventArgs=function(propertyName){ScriptFX.PropertyChangedEventArgs.constructBase(this);this.$1_0=propertyName;} ScriptFX.PropertyChangedEventArgs.prototype={$1_0:null,get_propertyName:function(){return this.$1_0;}} ScriptFX.ObservableCollection=function(owner,disposableItems){this.$0=owner;this.$1=[];this.$2=disposableItems;} ScriptFX.ObservableCollection.prototype={$0:null,$1:null,$2:false,$3:null,add_collectionChanged:function(value){this.$3=Delegate.combine(this.$3,value);},remove_collectionChanged:function(value){this.$3=Delegate.remove(this.$3,value);},add:function(item){(item).setOwner(this.$0);this.$1.add(item);if(this.$3!=null){this.$3.invoke(this,new ScriptFX.CollectionChangedEventArgs(0,item));}},clear:function(){if(this.$1.length!==0){var $enum1=this.$1.getEnumerator();while($enum1.moveNext()){var $0=$enum1.get_current();$0.setOwner(null);}this.$1.clear();if(this.$3!=null){this.$3.invoke(this,new ScriptFX.CollectionChangedEventArgs(2,null));}}},contains:function(item){return this.$1.contains(item);},dispose:function(){if(this.$2){var $enum1=this.$1.getEnumerator();while($enum1.moveNext()){var $0=$enum1.get_current();$0.dispose();}}this.$1=null;this.$0=null;this.$3=null;},getEnumerator:function(){return this.$1.getEnumerator();},getItem:function(index){return this.$1[index];},getItems:function(){return this.$1;},getLength:function(){return this.$1.length;},remove:function(item){if(this.$1.contains(item)){(item).setOwner(null);this.$1.remove(item);if(this.$3!=null){this.$3.invoke(this,new ScriptFX.CollectionChangedEventArgs(1,item));}}}} Type.createNamespace('ScriptFX.Net');ScriptFX.Net.HTTPStatusCode=function(){};ScriptFX.Net.HTTPStatusCode.prototype = {canContinue:100,switchingProtocols:101,OK:200,created:201,partialContent:206,accepted:202,nonAuthoritativeInformation:203,noContent:204,resetContent:205,ambiguous:300,moved:301,redirect:302,redirectMethod:303,notModified:304,useProxy:305,temporaryRedirect:307,badRequest:400,methodNotAllowed:400,unauthorized:401,paymentRequired:402,forbidden:403,notFound:404,notAcceptable:406,proxyAuthenticationRequired:407,requestTimeout:408,conflict:409,gone:410,lengthRequired:411,preconditionFailed:412,requestEntityTooLarge:413,requestUriTooLong:414,unsupportedMediaType:415,requestedRangeNotSatisfiable:416,expectationFailed:417,internalServerError:500,notImplemented:501,badGateway:502,serviceUnavailable:503,gatewayTimeout:504,httpVersionNotSupported:505} ScriptFX.Net.HTTPStatusCode.createEnum('ScriptFX.Net.HTTPStatusCode',false);ScriptFX.Net.HTTPRequestState=function(){};ScriptFX.Net.HTTPRequestState.prototype = {inactive:0,inProgress:1,completed:2,aborted:3,timedOut:4} ScriptFX.Net.HTTPRequestState.createEnum('ScriptFX.Net.HTTPRequestState',false);ScriptFX.Net.HTTPVerb=function(){};ScriptFX.Net.HTTPVerb.prototype = {GET:0,POST:1,PUT:2,DELETE:3} ScriptFX.Net.HTTPVerb.createEnum('ScriptFX.Net.HTTPVerb',false);ScriptFX.Net.IHTTPResponse=function(){};ScriptFX.Net.IHTTPResponse.createInterface('ScriptFX.Net.IHTTPResponse');ScriptFX.Net.HTTPRequest=function(){} ScriptFX.Net.HTTPRequest.createRequest=function(uri,verb){var $0=new ScriptFX.Net.HTTPRequest();if(!uri.startsWith('{')){$0.$0=uri;}else{var $1=ScriptFX.JSON.deserialize(uri);$0.$0=$1['__uri'];if($1['__nullParams']){$0.$6=$1['__transportType'];}else{$0.$6=Type.getType($1['__transportType']);delete $1.__uri;delete $1.__transportType;$0.$7=$1;}}$0.$1=verb;return $0;} ScriptFX.Net.HTTPRequest.createURI=function(uri,parameters){var $0=new StringBuilder(uri);if(uri.indexOf('?')<0){$0.append('?');}var $1=0;var $dict1=parameters;for(var $key2 in $dict1){var $2={key:$key2,value:$dict1[$key2]};if($1!==0){$0.append('&');}$0.append($2.key);$0.append('=');$0.append(encodeURIComponent($2.value.toString()));$1++;}return $0.toString();} ScriptFX.Net.HTTPRequest.prototype={$0:null,$1:0,$2:null,$3:null,$4:null,$5:null,$6:null,$7:null,$8:0,$9:null,$A:null,$B:0,$C:null,$D:null,$E:null,get_content:function(){return this.$2;},set_content:function(value){this.$2=value;return value;},get_hasCredentials:function(){return (!String.isNullOrEmpty(this.$4));},get_hasHeaders:function(){return (this.$3!=null);},get_headers:function(){if(this.$3==null){this.$3={};}return this.$3;},get_password:function(){return this.$5;},get_response:function(){return this.$D;},get_state:function(){return this.$B;},get_timeout:function(){return this.$8;},set_timeout:function(value){this.$8=value;return value;},get_timeStamp:function(){return this.$E;},get_$F:function(){return this.$C;},get_$10:function(){return this.$7;},get_transportType:function(){return this.$6;},get_URI:function(){return this.$0;},get_userName:function(){return this.$4;},get_verb:function(){return this.$1;},abort:function(){if(this.$B===1){ScriptFX.Net.HTTPRequestManager.$5(this,false);}},dispose:function(){if(this.$C!=null){this.abort();}},invoke:function(callback,context){this.$9=callback;this.$A=context;ScriptFX.Application.current.registerDisposableObject(this);ScriptFX.Net.HTTPRequestManager.$6(this);},$11:function(){ScriptFX.Application.current.unregisterDisposableObject(this);if(this.$C!=null){this.$C.dispose();this.$C=null;}if(this.$9!=null){this.$9.invoke(this,this.$A);this.$9=null;this.$A=null;}},$12:function(){this.$B=3;this.$11();},$13:function($p0){this.$C=$p0;this.$B=1;this.$E=new Date();},$14:function($p0){this.$D=$p0;this.$B=2;this.$11();},$15:function(){this.$B=4;this.$11();},setContentAsForm:function(data){this.get_headers()['Content-Type']='application/x-www-form-urlencoded';var $0=new StringBuilder();var $1=true;var $dict1=data;for(var $key2 in $dict1){var $2={key:$key2,value:$dict1[$key2]};if(!$1){$0.append('&');}$0.append($2.key);$0.append('=');$0.append(encodeURIComponent($2.value.toString()));$1=false;}this.set_content($0.toString());},setContentAsJSON:function(data){this.get_headers()['Content-Type']='text/json';this.set_content(ScriptFX.JSON.serialize(data));},setCredentials:function(userName,password){this.$4=userName;this.$5=password;}} ScriptFX.Net.HTTPRequestManager=function(){} ScriptFX.Net.HTTPRequestManager.add_requestInvoking=function(value){ScriptFX.Net.HTTPRequestManager.$0=Delegate.combine(ScriptFX.Net.HTTPRequestManager.$0,value);} ScriptFX.Net.HTTPRequestManager.remove_requestInvoking=function(value){ScriptFX.Net.HTTPRequestManager.$0=Delegate.remove(ScriptFX.Net.HTTPRequestManager.$0,value);} ScriptFX.Net.HTTPRequestManager.add_requestInvoked=function(value){ScriptFX.Net.HTTPRequestManager.$1=Delegate.combine(ScriptFX.Net.HTTPRequestManager.$1,value);} ScriptFX.Net.HTTPRequestManager.remove_requestInvoked=function(value){ScriptFX.Net.HTTPRequestManager.$1=Delegate.remove(ScriptFX.Net.HTTPRequestManager.$1,value);} ScriptFX.Net.HTTPRequestManager.get_online=function(){return window.navigator.onLine;} ScriptFX.Net.HTTPRequestManager.get_timeoutInterval=function(){return ScriptFX.Net.HTTPRequestManager.$2;} ScriptFX.Net.HTTPRequestManager.set_timeoutInterval=function(value){ScriptFX.Net.HTTPRequestManager.$2=value;return value;} ScriptFX.Net.HTTPRequestManager.$5=function($p0,$p1){var $0=$p0.get_$F();if($0!=null){$0.abort();ScriptFX.Net.HTTPRequestManager.$7($p0,null,$p1);}} ScriptFX.Net.HTTPRequestManager.abortAll=function(){var $0=ScriptFX.Net.HTTPRequestManager.$3;ScriptFX.Net.HTTPRequestManager.$3=[];var $enum1=$0.getEnumerator();while($enum1.moveNext()){var $1=$enum1.get_current();ScriptFX.Net.HTTPRequestManager.$5($1,false);}} ScriptFX.Net.HTTPRequestManager.$6=function($p0){if(ScriptFX.Net.HTTPRequestManager.$0!=null){var $2=new ScriptFX.Net.PreHTTPRequestEventArgs($p0);ScriptFX.Net.HTTPRequestManager.$0.invoke(null,$2);if($2.get_isSuppressed()){$p0.$14($2.get_response());return;}}var $0=$p0.get_transportType();if($0==null){$0=ScriptFX.Net._Core$3;}var $1=new $0($p0);$p0.$13($1);ScriptFX.Net.HTTPRequestManager.$3.add($p0);$1.invoke();if(((ScriptFX.Net.HTTPRequestManager.$2!==0)||($p0.get_timeout()!==0))&&(ScriptFX.Net.HTTPRequestManager.$4==null)){ScriptFX.Net.HTTPRequestManager.$4=Delegate.create(null,ScriptFX.Net.HTTPRequestManager.$8);ScriptFX.Application.current.add_idle(ScriptFX.Net.HTTPRequestManager.$4);}} ScriptFX.Net.HTTPRequestManager.$7=function($p0,$p1,$p2){ScriptFX.Net.HTTPRequestManager.$3.remove($p0);if($p1!=null){$p0.$14($p1);}else if($p2){$p0.$15();}else{$p0.$12();}if(ScriptFX.Net.HTTPRequestManager.$1!=null){var $0=new ScriptFX.Net.PostHTTPRequestEventArgs($p0,$p1);ScriptFX.Net.HTTPRequestManager.$1.invoke(null,$0);}if((ScriptFX.Net.HTTPRequestManager.$3.length===0)&&(ScriptFX.Net.HTTPRequestManager.$4!=null)){ScriptFX.Application.current.remove_idle(ScriptFX.Net.HTTPRequestManager.$4);ScriptFX.Net.HTTPRequestManager.$4=null;}} ScriptFX.Net.HTTPRequestManager.$8=function($p0,$p1){if(ScriptFX.Net.HTTPRequestManager.$3.length===0){return;}var $0=null;var $1=new Date().getTime();var $enum1=ScriptFX.Net.HTTPRequestManager.$3.getEnumerator();while($enum1.moveNext()){var $2=$enum1.get_current();var $3=$2.get_timeStamp().getTime();var $4=$2.get_timeout();if($4===0){$4=ScriptFX.Net.HTTPRequestManager.$2;if($4===0){continue;}}if(($1-$3)>$4){if($0==null){$0=[];}$0.add($2);}}if($0!=null){var $enum2=$0.getEnumerator();while($enum2.moveNext()){var $5=$enum2.get_current();ScriptFX.Net.HTTPRequestManager.$5($5,true);}}} ScriptFX.Net.HTTPRequestManager.$9=function($p0,$p1){ScriptFX.Net.HTTPRequestManager.$7($p0,$p1,false);} ScriptFX.Net.HTTPTransport=function(request){this.$0=request;} ScriptFX.Net.HTTPTransport.createURI=function(uri,transportType,parameters){if(parameters==null){return '{__nullParams: true, __uri:\''+uri+'\', __transportType: '+transportType.get_fullName()+'}';}else{parameters['__uri']=uri;parameters['__transportType']=transportType.get_fullName();return ScriptFX.JSON.serialize(parameters);}} ScriptFX.Net.HTTPTransport.prototype={$0:null,get_parameters:function(){return this.$0.get_$10();},get_request:function(){return this.$0;},getMethod:function(){return Enum.toString(ScriptFX.Net.HTTPVerb,this.$0.get_verb());},onCompleted:function(response){ScriptFX.Net.HTTPRequestManager.$9(this.$0,response);}} ScriptFX.Net.PostHTTPRequestEventArgs=function(request,response){ScriptFX.Net.PostHTTPRequestEventArgs.constructBase(this);this.$1_0=request;this.$1_1=response;} ScriptFX.Net.PostHTTPRequestEventArgs.prototype={$1_0:null,$1_1:null,get_request:function(){return this.$1_0;},get_response:function(){return this.$1_1;}} ScriptFX.Net.PreHTTPRequestEventArgs=function(request){ScriptFX.Net.PreHTTPRequestEventArgs.constructBase(this);this.$1_0=request;} ScriptFX.Net.PreHTTPRequestEventArgs.prototype={$1_0:null,$1_1:null,$1_2:false,get_isSuppressed:function(){return this.$1_2;},get_request:function(){return this.$1_0;},get_response:function(){return this.$1_1;},suppressRequest:function(response){this.$1_2=true;this.$1_1=response;}} ScriptFX.Net._Core$2=function(request,xmlHTTP){this.$3=new Date();this.$0=request;this.$1=xmlHTTP;} ScriptFX.Net._Core$2.prototype={$0:null,$1:null,$2:null,$3:null,$4:null,$5:null,$6:null,get_contentLength:function(){return this.getText().length;},get_contentType:function(){return this.$1.getResponseHeader('Content-Type');},get_headers:function(){if(this.$2==null){var $0=this.$1.getAllResponseHeaders();var $1=$0.split('\n');this.$2={};var $enum1=$1.getEnumerator();while($enum1.moveNext()){var $2=$enum1.get_current();var $3=$2.indexOf(':');this.$2[$2.substr(0,$3)]=$2.substr($3+1).trim();}}return this.$2;},get_request:function(){return this.$0;},get_statusCode:function(){return this.$1.status;},get_statusText:function(){return this.$1.statusText;},get_timeStamp:function(){return this.$3;},getHeader:function($p0){return this.$1.getResponseHeader($p0);},getObject:function(){if(this.$5==null){this.$5=ScriptFX.JSON.deserialize(this.getText());}return this.$5;},getText:function(){if(this.$4==null){this.$4=this.$1.responseText;}return this.$4;},getXML:function(){if(this.$6==null){var $0=this.$1.responseXML;if(($0==null)||($0.documentElement==null)){try{$0=XMLDocumentParser.parse(this.$1.responseText);if(($0!=null)&&($0.documentElement!=null)){this.$6=$0;}}catch($1){}}else{this.$6=$0;if(ScriptFX.Application.current.get_isIE()){$0.setProperty('SelectionLanguage','XPath');}}}return this.$6;}} ScriptFX.Net._Core$3=function(request){ScriptFX.Net._Core$3.constructBase(this,[request]);} ScriptFX.Net._Core$3.prototype={$1:null,abort:function(){if(this.$1!=null){this.$1.onreadystatechange=Delegate.Null;this.$1.abort();this.$1=null;}},dispose:function(){this.abort();},invoke:function(){var $0=this.get_request();this.$1=new XMLHttpRequest();this.$1.onreadystatechange=Delegate.create(this,this.$2);if(!this.get_request().get_hasCredentials()){this.$1.open(this.getMethod(),$0.get_URI(),true);}else{this.$1.open(this.getMethod(),$0.get_URI(),true,$0.get_userName(),$0.get_password());}var $1=($0.get_hasHeaders())?$0.get_headers():null;if($1!=null){var $dict1=$1;for(var $key2 in $dict1){var $3={key:$key2,value:$dict1[$key2]};this.$1.setRequestHeader($3.key,$3.value);}}var $2=$0.get_content();if(($2!=null)&&(($1==null)||($1['Content-Type']==null))){this.$1.setRequestHeader('Content-Type','application/x-www-form-urlencoded');}this.$1.send($2);},$2:function(){if(this.$1.readyState===4){var $0=new ScriptFX.Net._Core$2(this.get_request(),this.$1);this.$1.onreadystatechange=Delegate.Null;this.$1=null;this.onCompleted($0);}}} Type.createNamespace('ScriptFX.UI');ScriptFX.UI.AnimationStopState=function(){};ScriptFX.UI.AnimationStopState.prototype = {complete:0,abort:1,revert:2} ScriptFX.UI.AnimationStopState.createEnum('ScriptFX.UI.AnimationStopState',false);ScriptFX.UI.$create_Bounds=function(left,top,width,height){var $o={};$o.left=left;$o.top=top;$o.width=width;$o.height=height;return $o;} ScriptFX.UI.$create_DragDropData=function(mode,dataType,data){var $o={};$o.mode=mode;$o.dataType=dataType;$o.data=data;return $o;} ScriptFX.UI.DragMode=function(){};ScriptFX.UI.DragMode.prototype = {move:0,copy:1} ScriptFX.UI.DragMode.createEnum('ScriptFX.UI.DragMode',false);ScriptFX.UI.IAction=function(){};ScriptFX.UI.IAction.createInterface('ScriptFX.UI.IAction');ScriptFX.UI.IDragDrop=function(){};ScriptFX.UI.IDragDrop.createInterface('ScriptFX.UI.IDragDrop');ScriptFX.UI.IDragSource=function(){};ScriptFX.UI.IDragSource.createInterface('ScriptFX.UI.IDragSource');ScriptFX.UI.IDropTarget=function(){};ScriptFX.UI.IDropTarget.createInterface('ScriptFX.UI.IDropTarget');ScriptFX.UI.IEditableText=function(){};ScriptFX.UI.IEditableText.createInterface('ScriptFX.UI.IEditableText');ScriptFX.UI.IStaticText=function(){};ScriptFX.UI.IStaticText.createInterface('ScriptFX.UI.IStaticText');ScriptFX.UI.IToggle=function(){};ScriptFX.UI.IToggle.createInterface('ScriptFX.UI.IToggle');ScriptFX.UI.IValidator=function(){};ScriptFX.UI.IValidator.createInterface('ScriptFX.UI.IValidator');ScriptFX.UI.Key=function(){};ScriptFX.UI.Key.prototype = {backspace:8,tab:9,enter:13,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127} ScriptFX.UI.Key.createEnum('ScriptFX.UI.Key',false);ScriptFX.UI.$create_Location=function(left,top){var $o={};$o.left=left;$o.top=top;return $o;} ScriptFX.UI.$create_OverlayOptions=function(cssClass){var $o={};$o.cssClass=cssClass;$o.fadeInOutInterval=250;$o.opacity=0.75;return $o;} ScriptFX.UI.PopupMode=function(){};ScriptFX.UI.PopupMode.prototype = {center:0,anchorTopLeft:1,anchorTopRight:2,anchorBottomRight:3,anchorBottomLeft:4,alignTopLeft:5,alignTopRight:6,alignBottomRight:7,alignBottomLeft:8} ScriptFX.UI.PopupMode.createEnum('ScriptFX.UI.PopupMode',false);ScriptFX.UI.$create_PopupOptions=function(referenceElement,mode){var $o={};$o.referenceElement=referenceElement;$o.mode=mode;$o.id=null;$o.xOffset=0;$o.yOffset=0;return $o;} ScriptFX.UI.$create_Size=function(width,height){var $o={};$o.width=width;$o.height=height;return $o;} ScriptFX.UI.Animation=function(domElement){if(domElement==null){domElement=document.documentElement;}this.$0=domElement;this.$1=1;ScriptFX.Application.current.registerDisposableObject(this);} ScriptFX.UI.Animation.prototype={$0:null,$1:0,$2:false,$3:0,$4:false,$5:false,$6:false,$7:0,$8:0,$9:false,add_repeating:function(value){this.$A=Delegate.combine(this.$A,value);},remove_repeating:function(value){this.$A=Delegate.remove(this.$A,value);},$A:null,add_starting:function(value){this.$B=Delegate.combine(this.$B,value);},remove_starting:function(value){this.$B=Delegate.remove(this.$B,value);},$B:null,add_stopped:function(value){this.$C=Delegate.combine(this.$C,value);},remove_stopped:function(value){this.$C=Delegate.remove(this.$C,value);},$C:null,get_autoReverse:function(){return this.$2;},set_autoReverse:function(value){this.$2=value;return value;},get_completed:function(){return this.$4;},get_domElement:function(){return this.$0;},get_isPlaying:function(){return this.$5;},get_isReversed:function(){return this.$9;},get_repeatCount:function(){return this.$1;},set_repeatCount:function(value){this.$1=value;return value;},get_repeatDelay:function(){return this.$3;},set_repeatDelay:function(value){this.$3=value;return value;},get_repetitions:function(){return this.$7;},dispose:function(){if(this.$5){this.stop(1);}if(this.$0!=null){this.$0=null;ScriptFX.Application.current.unregisterDisposableObject(this);}},$D:function($p0){if(this.$B!=null){this.$B.invoke(this,EventArgs.Empty);}this.performSetup();this.$5=true;this.$7=1;this.$9=$p0;this.playCore();},$E:function($p0,$p1){this.stopCore($p0,$p1);this.$4=$p0;this.$5=false;this.performCleanup();if(this.$C!=null){this.$C.invoke(this,EventArgs.Empty);}},$F:function($p0){if(this.$6){if((this.$3!==0)&&((this.$8+this.$3)>$p0)){return false;}}var $0=this.progressCore(this.$6,$p0);this.$6=false;if($0&&((this.$1===0)||(this.$1>this.$7))){$0=false;this.$7++;if(this.$A!=null){var $1=new ScriptFX.CancelEventArgs();this.$A.invoke(this,$1);$0=$1.get_canceled();}if(!$0){this.$6=true;if(this.$2){this.$9=!this.$9;}this.$8=$p0;this.performRepetition(this.$9);}}return $0;},performCleanup:function(){},performRepetition:function(reversed){},performSetup:function(){},play:function(){this.$4=false;ScriptFX.UI.AnimationManager.$4(this);},stop:function(stopState){ScriptFX.UI.AnimationManager.$5(this,stopState);}} ScriptFX.UI.AnimationManager=function(){} ScriptFX.UI.AnimationManager.get_FPS=function(){return ScriptFX.UI.AnimationManager.$0;} ScriptFX.UI.AnimationManager.set_FPS=function(value){ScriptFX.UI.AnimationManager.$0=value;return value;} ScriptFX.UI.AnimationManager.$3=function(){ScriptFX.UI.AnimationManager.$2=0;if(ScriptFX.UI.AnimationManager.$1.length===0){return;}var $0=new Date().getTime();var $1=ScriptFX.UI.AnimationManager.$1;var $2=[];ScriptFX.UI.AnimationManager.$1=null;var $enum1=$1.getEnumerator();while($enum1.moveNext()){var $3=$enum1.get_current();var $4=$3.$F($0);if($4){$3.$E(true,0);}else{$2.add($3);}}if($2.length!==0){ScriptFX.UI.AnimationManager.$1=$2;if(ScriptFX.UI.AnimationManager.$2===0){ScriptFX.UI.AnimationManager.$2=window.setTimeout(Delegate.create(null,ScriptFX.UI.AnimationManager.$3),1000/ScriptFX.UI.AnimationManager.$0);}}} ScriptFX.UI.AnimationManager.$4=function($p0){if(ScriptFX.UI.AnimationManager.$1==null){ScriptFX.UI.AnimationManager.$1=[];}ScriptFX.UI.AnimationManager.$1.add($p0);$p0.$D(false);if(ScriptFX.UI.AnimationManager.$2===0){ScriptFX.UI.AnimationManager.$2=window.setTimeout(Delegate.create(null,ScriptFX.UI.AnimationManager.$3),1000/ScriptFX.UI.AnimationManager.$0);}} ScriptFX.UI.AnimationManager.$5=function($p0,$p1){$p0.$E(false,$p1);ScriptFX.UI.AnimationManager.$1.remove($p0);} ScriptFX.UI.AnimationSequence=function(animations){ScriptFX.UI.AnimationSequence.constructBase(this,[null]);this.$10=animations;this.$12=-1;} ScriptFX.UI.AnimationSequence.prototype={$10:null,$11:0,$12:0,$13:false,$14:0,get_successionDelay:function(){return this.$11;},set_successionDelay:function(value){this.$11=value;return value;},playCore:function(){if(!this.get_isReversed()){this.$12=0;}else{this.$12=this.$10.length-1;}this.$10[this.$12].$D(this.get_isReversed());},progressCore:function(startRepetition,timeStamp){if(startRepetition){if(!this.get_isReversed()){this.$12=0;}else{this.$12=this.$10.length-1;}this.$13=true;}var $0=this.$10[this.$12];if(this.$13){if((this.$11!==0)&&((this.$14+this.$11)>timeStamp)){return false;}this.$13=false;$0.$D(this.get_isReversed());}var $1=$0.$F(timeStamp);if($1){$0.$E(true,0);if(!this.get_isReversed()){this.$12++;}else{this.$12--;}this.$13=true;this.$14=timeStamp;}return $1&&((this.$12===this.$10.length)||(this.$12===-1));},stopCore:function(completed,stopState){if(!completed){var $0=this.$10[this.$12];$0.$E(false,stopState);}}} ScriptFX.UI.Behavior=function(domElement,id){ScriptFX.Application.current.registerDisposableObject(this);this.$0=domElement;this.$1=id;if(!String.isNullOrEmpty(id)){if(id==='control'){var $1=domElement[id];if(($1!=null)&&(Type.getInstanceType($1)===ScriptFX.UI._Core$4)){delete domElement.control;ScriptFX.Application.current.unregisterDisposableObject($1);this.$3=$1.get_$5();}}domElement[id] = this;}if(id!=='control'){var $2=domElement.control;if($2==null){$2=new ScriptFX.UI._Core$4(domElement);}}var $0=domElement._behaviors;if($0==null){$0=[];domElement._behaviors = $0;}$0.add(this);} ScriptFX.UI.Behavior.getBehavior=function(domElement,type){var $0=domElement._behaviors;if($0!=null){var $enum1=$0.getEnumerator();while($enum1.moveNext()){var $1=$enum1.get_current();if(type.isAssignableFrom(Type.getInstanceType($1))){return $1;}}}return null;} ScriptFX.UI.Behavior.getBehaviors=function(domElement,type){var $0=domElement._behaviors;if(isNullOrUndefined($0)||($0.length===0)){return null;}if(type==null){return $0.clone();}return $0.filter(Delegate.create(null,function($p1_0){ return type.isAssignableFrom(Type.getInstanceType($p1_0));}));} ScriptFX.UI.Behavior.getNamedBehavior=function(domElement,id){return domElement[id];} ScriptFX.UI.Behavior.prototype={$0:null,$1:null,$2:null,$3:null,$4:false,get_domElement:function(){return this.$0;},get_domEvents:function(){if(this.$2==null){this.$2=new ScriptFX.UI.DOMEventList(this.$0);}return this.$2;},get_events:function(){if(this.$3==null){this.$3=new ScriptFX.EventList();}return this.$3;},get_$5:function(){return this.$3;},get_isDisposed:function(){return (this.$0==null);},get_isInitializing:function(){return this.$4;},add_propertyChanged:function(value){this.get_events().addHandler('PropertyChanged',value);},remove_propertyChanged:function(value){this.get_events().removeHandler('PropertyChanged',value);},beginInitialize:function(){this.$4=true;},dispose:function(){if(this.$2!=null){this.$2.dispose();}if(this.$0!=null){if(this.$1!=null){if(ScriptFX.Application.current.get_isIE()){this.$0.removeAttribute(this.$1);}else{delete this.$0[this.$1];}}var $0=this.$0._behaviors;$0.remove(this);this.$0=null;ScriptFX.Application.current.unregisterDisposableObject(this);}},endInitialize:function(){this.$4=false;},raisePropertyChanged:function(propertyName){var $0=this.get_events().getHandler('PropertyChanged');if($0!=null){$0.invoke(this,new ScriptFX.PropertyChangedEventArgs(propertyName));}}} ScriptFX.UI.Color=function(red,green,blue){this.$0=red;this.$1=green;this.$2=blue;} ScriptFX.UI.Color.format=function(red,green,blue){return String.format('#{0:X2}{1:X2}{2:X2}',red,green,blue);} ScriptFX.UI.Color.parse=function(s){if(String.isNullOrEmpty(s)){return null;}if((s.length===7)&&s.startsWith('#')){var $0=parseInt(s.substr(1,2),16);var $1=parseInt(s.substr(3,2),16);var $2=parseInt(s.substr(5,2),16);return new ScriptFX.UI.Color($0,$1,$2);}else if(s.startsWith('rgb(')&&s.endsWith(')')){var $3=s.substring(4,s.length-1).split(',');if($3.length===3){return new ScriptFX.UI.Color(parseInt($3[0].trim()),parseInt($3[1].trim()),parseInt($3[2].trim()));}}return null;} ScriptFX.UI.Color.prototype={$0:0,$1:0,$2:0,get_blue:function(){return this.$2;},get_green:function(){return this.$1;},get_red:function(){return this.$0;},toString:function(){return ScriptFX.UI.Color.format(this.$0,this.$1,this.$2);}} ScriptFX.UI.Control=function(domElement){ScriptFX.UI.Control.constructBase(this,[domElement,'control']);} ScriptFX.UI.Control.getControl=function(domElement){return ScriptFX.UI.Behavior.getNamedBehavior(domElement,'control');} ScriptFX.UI.Control.prototype={add_disposing:function(value){this.get_events().addHandler('disposing',value);},remove_disposing:function(value){this.get_events().removeHandler('disposing',value);},dispose:function(){var $0=this.get_domElement();if($0!=null){var $1=this.get_events().getHandler('disposing');if($1!=null){$1.invoke(this,EventArgs.Empty);}var $2=ScriptFX.UI.Behavior.getBehaviors($0,null);if($2.length>1){var $enum1=$2.getEnumerator();while($enum1.moveNext()){var $3=$enum1.get_current();if($3!==this){$3.dispose();}}}}ScriptFX.UI.Control.callBase(this, 'dispose');}} ScriptFX.UI.DOMEventList=function(element){this.$0=element;this.$1={};} ScriptFX.UI.DOMEventList.prototype={$0:null,$1:null,attach:function(eventName,handler){this.$0.attachEvent(eventName,handler);this.$1[eventName]=handler;},detach:function(eventName){var $0=this.$1[eventName];if($0!=null){this.$0.detachEvent(eventName,$0);delete this.$1[eventName];return true;}return false;},dispose:function(){if(this.$0!=null){var $dict1=this.$1;for(var $key2 in $dict1){var $0={key:$key2,value:$dict1[$key2]};this.$0.detachEvent($0.key,$0.value);}this.$0=null;this.$1=null;}},isAttached:function(eventName){return (this.$1[eventName]!=null)?true:false;}} ScriptFX.UI.DragDropEventArgs=function(dataObject){ScriptFX.UI.DragDropEventArgs.constructBase(this);this.$1_0=dataObject;} ScriptFX.UI.DragDropEventArgs.prototype={$1_0:null,get_dataObject:function(){return this.$1_0;}} ScriptFX.UI.DragDropManager=function(){} ScriptFX.UI.DragDropManager.get_canDragDrop=function(){return (ScriptFX.UI.DragDropManager.$0!=null);} ScriptFX.UI.DragDropManager.get_supportsDataTransfer=function(){return ScriptFX.UI.DragDropManager.$0.get_supportsDataTransfer();} ScriptFX.UI.DragDropManager.add_dragDropEnding=function(value){ScriptFX.UI.DragDropManager.$3=Delegate.combine(ScriptFX.UI.DragDropManager.$3,value);} ScriptFX.UI.DragDropManager.remove_dragDropEnding=function(value){ScriptFX.UI.DragDropManager.$3=Delegate.remove(ScriptFX.UI.DragDropManager.$3,value);} ScriptFX.UI.DragDropManager.add_dragDropStarting=function(value){ScriptFX.UI.DragDropManager.$2=Delegate.combine(ScriptFX.UI.DragDropManager.$2,value);} ScriptFX.UI.DragDropManager.remove_dragDropStarting=function(value){ScriptFX.UI.DragDropManager.$2=Delegate.remove(ScriptFX.UI.DragDropManager.$2,value);} ScriptFX.UI.DragDropManager.$5=function(){if(ScriptFX.UI.DragDropManager.$3!=null){ScriptFX.UI.DragDropManager.$3.invoke(null,new ScriptFX.UI.DragDropEventArgs(ScriptFX.UI.DragDropManager.$4));}ScriptFX.UI.DragDropManager.$4=null;} ScriptFX.UI.DragDropManager.registerDragDropImplementation=function(dragDrop){ScriptFX.UI.DragDropManager.$0=dragDrop;} ScriptFX.UI.DragDropManager.registerDropTarget=function(target){ScriptFX.UI.DragDropManager.$1.add(target);} ScriptFX.UI.DragDropManager.startDragDrop=function(data,dragVisual,dragOffset,source,context){if(ScriptFX.UI.DragDropManager.$4!=null){return false;}var $0=[];var $enum1=ScriptFX.UI.DragDropManager.$1.getEnumerator();while($enum1.moveNext()){var $1=$enum1.get_current();if($1.supportsDataObject(data)){$0.add($1);}}if($0.length===0){return false;}ScriptFX.UI.DragDropManager.$4=data;if(ScriptFX.UI.DragDropManager.$2!=null){ScriptFX.UI.DragDropManager.$2.invoke(null,new ScriptFX.UI.DragDropEventArgs(data));}ScriptFX.UI.DragDropManager.$0.dragDrop(new ScriptFX.UI._Core$0(source),context,$0,dragVisual,dragOffset,ScriptFX.UI.DragDropManager.$4);return true;} ScriptFX.UI.DragDropManager.unregisterDropTarget=function(target){ScriptFX.UI.DragDropManager.$1.remove(target);} ScriptFX.UI._Core$0=function(actualSource){this.$0=actualSource;} ScriptFX.UI._Core$0.prototype={$0:null,get_domElement:function(){return this.$0.get_domElement();},onDragStart:function($p0){if(this.$0!=null){this.$0.onDragStart($p0);}},onDrag:function($p0){if(this.$0!=null){this.$0.onDrag($p0);}},onDragEnd:function($p0,$p1){if(this.$0!=null){this.$0.onDragEnd($p0,$p1);}ScriptFX.UI.DragDropManager.$5();}} ScriptFX.UI.Element=function(){} ScriptFX.UI.Element.addCSSClass=function(element,className){var $0=element.className;if($0.indexOf(className)<0){element.className=$0+' '+className;}} ScriptFX.UI.Element.containsCSSClass=function(element,className){return element.className.split(' ').contains(className);} ScriptFX.UI.Element.getBounds=function(element){var $0=ScriptFX.UI.Element.getLocation(element);return ScriptFX.UI.$create_Bounds($0.left,$0.top,element.offsetWidth,element.offsetHeight);} ScriptFX.UI.Element.getLocation=function(element){var $0=0;var $1=0;for(var $2=element;$2!=null;$2=$2.offsetParent){$0+=$2.offsetLeft;$1+=$2.offsetTop;}return ScriptFX.UI.$create_Location($0,$1);} ScriptFX.UI.Element.getSize=function(element){return ScriptFX.UI.$create_Size(element.offsetWidth,element.offsetHeight);} ScriptFX.UI.Element.removeCSSClass=function(element,className){var $0=' '+element.className+' ';var $1=$0.indexOf(' '+className+' ');if($1>=0){var $2=$0.substr(0,$1)+' '+$0.substr($1+className.length+1);element.className=$2;}} ScriptFX.UI.Element.setLocation=function(element,location){element.style.left=location.left+'px';element.style.top=location.top+'px';} ScriptFX.UI.Element.setSize=function(element,size){element.style.width=size.width+'px';element.style.height=size.height+'px';} ScriptFX.UI.FadeEffect=function(domElement,duration,opacity){ScriptFX.UI.FadeEffect.constructBase(this,[domElement,duration]);this.$14=opacity;} ScriptFX.UI.FadeEffect.prototype={$13:false,$14:0,get_isFadingIn:function(){return this.$13;},fadeIn:function(){if(this.get_isPlaying()){this.stop(0);}this.$13=true;this.play();},fadeOut:function(){if(this.get_isPlaying()){this.stop(0);}this.$13=false;this.play();},performCleanup:function(){ScriptFX.UI.FadeEffect.callBase(this, 'performCleanup');if(!this.$13){this.$15(0);this.get_domElement().style.display='none';}},performSetup:function(){ScriptFX.UI.FadeEffect.callBase(this, 'performSetup');if(this.$13){this.$15(0);this.get_domElement().style.display='';}},performTweening:function(frame){if(this.$13){this.$15(this.$14*frame);}else{this.$15(this.$14*(1-frame));}},$15:function($p0){if(ScriptFX.Application.current.get_isIE()){this.get_domElement().style.filter='alpha(opacity='+($p0*100)+')';}else{this.get_domElement().style.opacity=$p0.toString();}}} ScriptFX.UI._Core$4=function(domElement){ScriptFX.UI._Core$4.constructBase(this,[domElement]);} ScriptFX.UI.OverlayBehavior=function(domElement,options){ScriptFX.UI.OverlayBehavior.constructBase(this,[domElement,options.id]);this.$7=document.createElement('div');this.$7.className=options.cssClass;var $0=this.$7.style;$0.display='none';$0.top='0px';$0.left='0px';$0.width='100%';if(ScriptFX.Application.current.get_isIE()&&(ScriptFX.Application.current.get_host().get_majorVersion()<7)){$0.position='absolute';}else{this.$8=true;$0.position='fixed';$0.height='100%';}document.body.appendChild(this.$7);if(options.fadeInOutInterval!==0){this.$9=new ScriptFX.UI.FadeEffect(this.$7,options.fadeInOutInterval,options.opacity);this.$9.set_easingFunction(Delegate.create(null,ScriptFX.UI.TimedAnimation.easeInOut));this.$9.add_stopped(Delegate.create(this,this.$C));}} ScriptFX.UI.OverlayBehavior.prototype={$7:null,$8:false,$9:null,$A:null,$B:false,get_isVisible:function(){return this.$B;},add_visibilityChanged:function(value){this.get_events().addHandler(ScriptFX.UI.OverlayBehavior.$6,value);},remove_visibilityChanged:function(value){this.get_events().removeHandler(ScriptFX.UI.OverlayBehavior.$6,value);},dispose:function(){if(this.$9!=null){this.$9.dispose();this.$9=null;}if(this.$A!=null){window.detachEvent('onresize',this.$A);this.$A=null;}ScriptFX.UI.OverlayBehavior.callBase(this, 'dispose');},hide:function(){if((!this.$B)||this.$9.get_isPlaying()){return;}if(this.$A!=null){window.detachEvent('onresize',this.$A);this.$A=null;}if(this.$9!=null){this.$9.fadeOut();}else{this.$7.style.display='none';this.$B=false;var $0=this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6);if($0!=null){$0.invoke(this,EventArgs.Empty);}}},$C:function($p0,$p1){this.$B=this.$9.get_isFadingIn();var $0=this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6);if($0!=null){$0.invoke(this,EventArgs.Empty);}},$D:function(){this.$7.style.height=document.documentElement.offsetHeight+'px';},show:function(){if(this.$B||this.$9.get_isPlaying()){return;}if(!this.$8){this.$7.style.height=document.documentElement.offsetHeight+'px';this.$A=Delegate.create(this,this.$D);window.attachEvent('onresize',this.$A);}if(this.$9!=null){this.$9.fadeIn();}else{this.$7.style.display='';this.$B=true;var $0=this.get_events().getHandler(ScriptFX.UI.OverlayBehavior.$6);if($0!=null){$0.invoke(this,EventArgs.Empty);}}}} ScriptFX.UI.PopupBehavior=function(domElement,options){ScriptFX.UI.PopupBehavior.constructBase(this,[domElement,options.id]);this.$6=options;domElement.style.position='absolute';domElement.style.display='none';} ScriptFX.UI.PopupBehavior.prototype={$6:null,$7:null,dispose:function(){if(this.get_domElement()!=null){this.hide();}ScriptFX.UI.PopupBehavior.callBase(this, 'dispose');},hide:function(){this.get_domElement().style.display='none';if(this.$7!=null){this.$7.parentNode.removeChild(this.$7);this.$7=null;}},show:function(){var $0=this.get_domElement().offsetParent;if($0==null){$0=document.documentElement;}this.get_domElement().style.display='block';var $1=0;var $2=0;var $3=1;var $4=1;var $5=false;var $6=ScriptFX.UI.Element.getBounds($0);var $7=ScriptFX.UI.Element.getBounds(this.get_domElement());var $8=ScriptFX.UI.Element.getBounds(this.$6.referenceElement);var $9=$8.left-$6.left;var $A=$8.top-$6.top;switch(this.$6.mode){case 0:$1=Math.round($8.width/2-$7.width/2);$2=Math.round($8.height/2-$7.height/2);break;case 1:$1=0;$2=-$7.height;break;case 2:$1=$8.width-$7.width;$2=-$7.height;break;case 3:$1=$8.width-$7.width;$2=$8.height;break;case 4:$1=0;$2=$8.height;break;case 5:$1=$8.left;$2=$8.top;$5=true;break;case 6:$1=$8.left+$8.width-$7.width;$2=$8.top;$3=-1;$5=true;break;case 7:$1=$8.left+$8.width-$7.width;$2=$8.top+$8.height-$7.height;$3=-1;$4=-1;$5=true;break;case 8:$1=$8.left;$2=$8.top+$8.height-$7.height;$4=-1;$5=true;break;}if(!$5){$1+=$9+this.$6.xOffset;$2+=$A+this.$6.yOffset;}else{$1+=$9+this.$6.xOffset*$3;$2+=$A+this.$6.yOffset*$4;}var $B=document.body.clientWidth;if($1+$7.width>$B-2){$1-=($1+$7.width-$B+2);}if($1<0){$1=2;}if($2<0){$2=2;}ScriptFX.UI.Element.setLocation(this.get_domElement(),ScriptFX.UI.$create_Location($1,$2));var $C=ScriptFX.Application.current.get_host();if(($C.get_name()===1)&&($C.get_majorVersion()<7)){this.$7=document.createElement('IFRAME');this.$7.src='javascript:false;';this.$7.scrolling='no';this.$7.style.position='absolute';this.$7.style.display='block';this.$7.style.border='none';this.$7.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';this.$7.style.left=$1+'px';this.$7.style.top=$2+'px';this.$7.style.width=$7.width+'px';this.$7.style.height=$7.height+'px';this.$7.style.zIndex=1;this.get_domElement().parentNode.insertBefore(this.$7,this.get_domElement());}}} ScriptFX.UI.TimedAnimation=function(domElement,duration){ScriptFX.UI.TimedAnimation.constructBase(this,[domElement]);this.$10=duration;} ScriptFX.UI.TimedAnimation.easeIn=function(t){return t*t;} ScriptFX.UI.TimedAnimation.easeInOut=function(t){t=t*2;if(t<1){return t*t/2;}return -((--t)*(t-2)-1)/2;} ScriptFX.UI.TimedAnimation.easeOut=function(t){return -t*(t-2);} ScriptFX.UI.TimedAnimation.prototype={$10:0,$11:null,$12:0,get_duration:function(){return this.$10;},set_duration:function(value){this.$10=value;return value;},get_easingFunction:function(){return this.$11;},set_easingFunction:function(value){this.$11=value;return value;},playCore:function(){this.$12=new Date().getTime();this.progressCore(false,this.$12);},progressCore:function(startRepetition,timeStamp){var $0=0;var $1=false;if(!startRepetition){$0=(timeStamp-this.$12)/this.$10;if(!this.get_isReversed()){$1=($0>=1);$0=Math.min(1,$0);}else{$0=1-$0;$1=($0<=0);$0=Math.max(0,$0);}if((!$1)&&(this.$11!=null)){$0=this.$11.invoke($0);}}else{this.$12=timeStamp;if(this.get_isReversed()){$0=1;}}this.performTweening($0);return $1;},stopCore:function(completed,stopState){if(!completed){if(stopState===0){this.performTweening(1);}else if(stopState===2){this.performTweening(0);}}}} ScriptFX.Application.createClass('ScriptFX.Application',null,IServiceProvider,IServiceContainer,ScriptFX.IEventManager);ScriptFX.CancelEventArgs.createClass('ScriptFX.CancelEventArgs',EventArgs);ScriptFX.CollectionChangedEventArgs.createClass('ScriptFX.CollectionChangedEventArgs',EventArgs);ScriptFX.ApplicationUnloadingEventArgs.createClass('ScriptFX.ApplicationUnloadingEventArgs',EventArgs);ScriptFX.HistoryManager.createClass('ScriptFX.HistoryManager',null,IDisposable);ScriptFX.HistoryEventArgs.createClass('ScriptFX.HistoryEventArgs',EventArgs);ScriptFX.HostInfo.createClass('ScriptFX.HostInfo');ScriptFX.EventList.createClass('ScriptFX.EventList');ScriptFX.JSON.createClass('ScriptFX.JSON');ScriptFX.PropertyChangedEventArgs.createClass('ScriptFX.PropertyChangedEventArgs',EventArgs);ScriptFX.ObservableCollection.createClass('ScriptFX.ObservableCollection',null,IDisposable,IArray,IEnumerable,ScriptFX.INotifyCollectionChanged);ScriptFX.Net.HTTPRequest.createClass('ScriptFX.Net.HTTPRequest',null,IDisposable);ScriptFX.Net.HTTPRequestManager.createClass('ScriptFX.Net.HTTPRequestManager');ScriptFX.Net.HTTPTransport.createClass('ScriptFX.Net.HTTPTransport',null,IDisposable);ScriptFX.Net.PostHTTPRequestEventArgs.createClass('ScriptFX.Net.PostHTTPRequestEventArgs',EventArgs);ScriptFX.Net.PreHTTPRequestEventArgs.createClass('ScriptFX.Net.PreHTTPRequestEventArgs',EventArgs);ScriptFX.Net._Core$2.createClass('ScriptFX.Net._Core$2',null,ScriptFX.Net.IHTTPResponse);ScriptFX.Net._Core$3.createClass('ScriptFX.Net._Core$3',ScriptFX.Net.HTTPTransport);ScriptFX.UI.Animation.createClass('ScriptFX.UI.Animation',null,IDisposable);ScriptFX.UI.AnimationManager.createClass('ScriptFX.UI.AnimationManager');ScriptFX.UI.AnimationSequence.createClass('ScriptFX.UI.AnimationSequence',ScriptFX.UI.Animation);ScriptFX.UI.Behavior.createClass('ScriptFX.UI.Behavior',null,IDisposable,ScriptFX.ISupportInitialize,ScriptFX.INotifyPropertyChanged);ScriptFX.UI.Color.createClass('ScriptFX.UI.Color');ScriptFX.UI.Control.createClass('ScriptFX.UI.Control',ScriptFX.UI.Behavior,ScriptFX.INotifyDisposing);ScriptFX.UI.DOMEventList.createClass('ScriptFX.UI.DOMEventList',null,IDisposable);ScriptFX.UI.DragDropEventArgs.createClass('ScriptFX.UI.DragDropEventArgs',EventArgs);ScriptFX.UI.DragDropManager.createClass('ScriptFX.UI.DragDropManager');ScriptFX.UI._Core$0.createClass('ScriptFX.UI._Core$0',null,ScriptFX.UI.IDragSource);ScriptFX.UI.Element.createClass('ScriptFX.UI.Element');ScriptFX.UI.TimedAnimation.createClass('ScriptFX.UI.TimedAnimation',ScriptFX.UI.Animation);ScriptFX.UI.FadeEffect.createClass('ScriptFX.UI.FadeEffect',ScriptFX.UI.TimedAnimation);ScriptFX.UI._Core$4.createClass('ScriptFX.UI._Core$4',ScriptFX.UI.Control);ScriptFX.UI.OverlayBehavior.createClass('ScriptFX.UI.OverlayBehavior',ScriptFX.UI.Behavior);ScriptFX.UI.PopupBehavior.createClass('ScriptFX.UI.PopupBehavior',ScriptFX.UI.Behavior);ScriptFX.Application.current=new ScriptFX.Application();ScriptFX.JSON.$0=null;ScriptFX.Net.HTTPRequestManager.$0=null;ScriptFX.Net.HTTPRequestManager.$1=null;ScriptFX.Net.HTTPRequestManager.$2=0;ScriptFX.Net.HTTPRequestManager.$3=[];ScriptFX.Net.HTTPRequestManager.$4=null;ScriptFX.UI.AnimationManager.$0=100;ScriptFX.UI.AnimationManager.$1=null;ScriptFX.UI.AnimationManager.$2=0;ScriptFX.UI.DragDropManager.$0=null;ScriptFX.UI.DragDropManager.$1=[];ScriptFX.UI.DragDropManager.$2=null;ScriptFX.UI.DragDropManager.$3=null;ScriptFX.UI.DragDropManager.$4=null;ScriptFX.UI.OverlayBehavior.$6='visibilityChanged'; // ---- Do not remove this footer ---- // This script was generated using Script# v0.5.5.0 (http://projects.nikhilk.net/ScriptSharp) // ----------------------------------- Type.createNamespace('Coveo.CNL.Web.Scripts.Ajax'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.IContentFlipper Coveo.CNL.Web.Scripts.Ajax.IContentFlipper = function() { /// /// Interface for objects that flip content. /// }; Coveo.CNL.Web.Scripts.Ajax.IContentFlipper.prototype = { get_newContent : null, flip : null } Coveo.CNL.Web.Scripts.Ajax.IContentFlipper.createInterface('Coveo.CNL.Web.Scripts.Ajax.IContentFlipper'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess = function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess() { /// /// Base class for asynchronous processes. /// /// /// } Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess.prototype = { _m_Manager: null, get_manager: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$get_manager() { /// /// The AsynchronousProcessManager that manages us. /// /// return this._m_Manager; }, set_manager: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$set_manager(value) { /// /// The AsynchronousProcessManager that manages us. /// /// this._m_Manager = value; return value; }, start: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$start() { /// /// Starts the asynchronous process. /// this.beginProcess(); }, terminate: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcess$terminate() { /// /// Forces the asynchronous process to terminate. /// this.endProcess(); if (this._m_Manager != null) { this._m_Manager.processIsDone(this); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.ControlFlipper Coveo.CNL.Web.Scripts.Ajax.ControlFlipper = function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper(p_Old, p_Html) { /// /// Implementation of for flipping the whole /// html for a control (including the outer tag). /// /// /// The old element that is being replaced. /// /// /// The updated html to replace with. /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Old); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Html); this._m_Old = p_Old; this._m_Html = p_Html; this._m_New = document.createElement('div'); this._m_New.style.display = 'none'; document.body.appendChild(this._m_New); this._m_New.innerHTML = this._m_Html; Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_New.children.length === 1); } Coveo.CNL.Web.Scripts.Ajax.ControlFlipper.prototype = { _m_Old: null, _m_Html: null, _m_New: null, get_newContent: function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper$get_newContent() { /// return this._m_New.firstChild; }, flip: function Coveo_CNL_Web_Scripts_Ajax_ControlFlipper$flip() { /// var child = this._m_New.firstChild; this._m_Old.parentNode.insertBefore(child, this._m_Old); this._m_Old.parentNode.removeChild(this._m_Old); this._m_New.parentNode.removeChild(this._m_New); return child; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.CollapseTransition Coveo.CNL.Web.Scripts.Ajax.CollapseTransition = function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition(p_Element, p_Flipper) { /// /// Transition effect that collapses a tag from it's normal size to nothing. /// /// /// The that we collapse. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_InitialHeight$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$beginTransition() { this._m_InitialHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.height = this._m_InitialHeight$2 + 'px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Element$2.style.display = 'none'; this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Flipper$2.flip(), this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_CollapseTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.height = ((this._m_InitialHeight$2 * Math.cos(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.CollapseTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AdjustTransition Coveo.CNL.Web.Scripts.Ajax.AdjustTransition = function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition(p_Element, p_Flipper) { /// /// Transition effect that gradually adjusts the size of an element. /// /// /// The that we adjust. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_InitialHeight$2: 0, _m_Offset$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$beginTransition() { this._m_InitialHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height; this._m_Element$2 = this._m_Flipper$2.flip(); this._m_Offset$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height - this._m_InitialHeight$2; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.height = this._m_InitialHeight$2 + 'px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_AdjustTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.height = ((this._m_InitialHeight$2 + this._m_Offset$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.AdjustTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.Console Coveo.CNL.Web.Scripts.Ajax.Console = function Coveo_CNL_Web_Scripts_Ajax_Console() { /// /// Implements a console on the client side for debugging purposes. /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.Ajax.Console._s_Console); Coveo.CNL.Web.Scripts.Ajax.Console._s_Console = this; this._m_Frame = document.createElement('div'); this._m_Frame.style.position = 'absolute'; this._m_Frame.style.left = '5%'; this._m_Frame.style.top = '5%'; this._m_Frame.style.width = '90%'; this._m_Frame.style.height = '90%'; this._m_Frame.style.border = '2px solid silver'; this._m_Frame.style.backgroundColor = 'whitesmoke'; document.body.appendChild(this._m_Frame); this._m_Content = document.createElement('div'); this._m_Content.style.fontFamily = 'Consolas'; this._m_Content.style.fontSize = '10pt'; this._m_Content.style.padding = '10px'; this._m_Frame.appendChild(this._m_Content); this._m_Frame.style.display = 'none'; document.body.attachEvent('onkeypress', Delegate.create(this, this._body_KeyPress)); Coveo.CNL.Web.Scripts.Ajax.Console.writeLine('allo'); Coveo.CNL.Web.Scripts.Ajax.Console.writeLine('toi'); } Coveo.CNL.Web.Scripts.Ajax.Console.writeLine = function Coveo_CNL_Web_Scripts_Ajax_Console$writeLine(p_Text) { /// /// Writes a line of text to the console. /// /// /// The text to write to the console. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Text); if (Coveo.CNL.Web.Scripts.Ajax.Console._s_Console != null) { Coveo.CNL.Web.Scripts.Ajax.Console._s_Console.outputLineOfText(p_Text); } } Coveo.CNL.Web.Scripts.Ajax.Console.writeHtmlLine = function Coveo_CNL_Web_Scripts_Ajax_Console$writeHtmlLine(p_Html) { /// /// Writes a line of html to the console. /// /// /// The html to write to the console. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Html); if (Coveo.CNL.Web.Scripts.Ajax.Console._s_Console != null) { Coveo.CNL.Web.Scripts.Ajax.Console._s_Console.outputLineOfHtml(p_Html); } } Coveo.CNL.Web.Scripts.Ajax.Console.prototype = { _m_Frame: null, _m_Content: null, _m_Visible: false, outputLineOfText: function Coveo_CNL_Web_Scripts_Ajax_Console$outputLineOfText(p_Text) { /// /// Writes a line of text to the console. /// /// /// The text to write to the console. /// var line = document.createElement('div'); line.innerText = p_Text; this._m_Content.appendChild(line); }, outputLineOfHtml: function Coveo_CNL_Web_Scripts_Ajax_Console$outputLineOfHtml(p_Html) { /// /// Writes a line of html to the console. /// /// /// The html to write to the console. /// var line = document.createElement('div'); line.innerHTML = p_Html; this._m_Content.appendChild(line); }, _body_KeyPress: function Coveo_CNL_Web_Scripts_Ajax_Console$_body_KeyPress() { if (window.event.keyCode === 126) { if (!this._m_Visible) { this._m_Frame.style.display = 'block'; this._m_Visible = true; } else { this._m_Frame.style.display = 'none'; this._m_Visible = false; } window.event.cancelBubble = true; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript() { /// /// Base class for client objects created using the AjaxObject class. /// /// /// } Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript.prototype = { _m_OwnerId: null, get_ownerId: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$get_ownerId() { /// /// The id of the control that owns the object. /// /// return this._m_OwnerId; }, set_ownerId: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$set_ownerId(value) { /// /// The id of the control that owns the object. /// /// this._m_OwnerId = value; return value; }, initialize: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$initialize() { /// /// Initializes the object after initialization from the server data is done. /// }, tearDown: function Coveo_CNL_Web_Scripts_Ajax_AjaxObjectScript$tearDown() { /// /// Tears down the object when his associated region of the DOM is removed or replaced. /// } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.BlankFeedback Coveo.CNL.Web.Scripts.Ajax.BlankFeedback = function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback(p_Element, p_Fullscreen) { /// /// Feedback that blanks the area to be updated until the postback finishes. /// /// /// The element to which the feedback is associated. /// /// /// Whether to display the feedback in fullscreen mode. /// /// /// /// /// /// /// /// /// The uri of the image to display. /// Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); this._m_Element$2 = p_Element; this._m_Fullscreen$2 = p_Fullscreen; } Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.prototype = { _m_Element$2: null, _m_Overlay$2: null, _m_Fullscreen$2: false, beginFeedback: function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback$beginFeedback() { var bounds; if (this._m_Fullscreen$2) { bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle(); } else { bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2.parentNode); bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getIntersection(bounds, Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle()); } this._m_Overlay$2 = document.createElement('div'); this._m_Overlay$2.style.backgroundColor = 'white'; this._m_Overlay$2.style.position = 'absolute'; this._m_Overlay$2.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, 0.75); document.body.appendChild(this._m_Overlay$2); Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, bounds); this._m_Overlay$2.innerHTML = '
'; }, endFeedback: function Coveo_CNL_Web_Scripts_Ajax_BlankFeedback$endFeedback() { document.body.removeChild(this._m_Overlay$2); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.Bootstrap Coveo.CNL.Web.Scripts.Ajax.Bootstrap = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap() { /// /// Provides methods for inserting an ASP.NET page form into a non-ASP.NET page. /// /// /// /// /// } Coveo.CNL.Web.Scripts.Ajax.Bootstrap.insertAjaxAspNetPage = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$insertAjaxAspNetPage(p_Path, p_Element, p_ForwardQueryString) { /// /// Inserts an Ajax ASP.NET page under a specified . /// /// /// The path on the local server from which to load the page. /// /// /// The element under which to insert the page. /// /// /// Whether to forward the content of the query string. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Path); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); if (p_Path.startsWith('http://') || p_Path.startsWith('https://')) { alert('The Path argument must not include a server name.'); } var target = p_Path; if (p_ForwardQueryString && !String.isNullOrEmpty(window.location.search)) { if (target.indexOf('?') === -1) { target += '?'; } else { target += '&'; } target += window.location.search.substr(1); } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element = p_Element; Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = new XMLHttpRequest(); Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.open('GET', target, true); Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK, '1'); Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP, '1'); if (window.location.hash != null) { Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_HISTORY_STATE, window.location.hash.substr(1)); } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.onreadystatechange = Delegate.create(null, function() { Coveo.CNL.Web.Scripts.Ajax.Bootstrap._requestCallback(p_Path); }); Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.send(''); } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._requestCallback = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_requestCallback(p_Uri) { /// /// Callback for request events. /// /// /// The uri of the page that is being bootstrapped. /// if (Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.readyState === 4) { if (Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.status === 200) { Coveo.CNL.Web.Scripts.Ajax.Bootstrap._doBootstrapFromXml(p_Uri, Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.responseXML); } else { Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.innerText = 'Cannot load the interface: ' + Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request.statusText; } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = null; } } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._doBootstrapFromXml = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_doBootstrapFromXml(p_Uri, p_Xml) { /// /// Performs the bootstraping using the xml returned by the server. /// /// /// The uri of the page that is being bootstrapped. /// /// /// The from which to bootstrap. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml); var bootstrap = p_Xml.selectSingleNode('/AjaxManager/Bootstrap'); Coveo.CNL.Web.Scripts.CNLAssert.notNull(bootstrap); Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.innerHTML = bootstrap.text; var form = Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element.getElementsByTagName('form')[0]; Coveo.CNL.Web.Scripts.CNLAssert.notNull(form); form.action = p_Uri; var viewstate = null; var inputs = form.getElementsByTagName('input'); for (var i = 0; i < inputs.length; ++i) { var input = inputs[i]; if (input.name === Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE) { viewstate = input.value; break; } } Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(viewstate); var id = (bootstrap.attributes.getNamedItem('Id')).value; Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(id); var mgr = new Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript(); eval('CNL_AjaxManager = mgr;'); mgr.set_bootstrap(true); mgr.set_initialViewState(viewstate); mgr.set_enableHistory(true); mgr.initialize(id, form, Delegate.create(null, Coveo.CNL.Web.Scripts.Ajax.Bootstrap._dummyDoPostBack), p_Xml, true); eval('__doPostBack = function(t, a) { CNL_AjaxManager.doPostBack(t, a); };'); } Coveo.CNL.Web.Scripts.Ajax.Bootstrap._dummyDoPostBack = function Coveo_CNL_Web_Scripts_Ajax_Bootstrap$_dummyDoPostBack(p_Target, p_Argument) { /// /// Dummy implementation of the framework's __doPostBack function. /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.fail(); } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript(p_Manager, p_PostBack) { /// /// Client side code for the AjaxProgress control. /// /// /// The object. /// /// /// The object. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_PostBack); this._m_Manager$1 = p_Manager; this._m_PostBack$1 = p_PostBack; Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(this._m_Manager$1.get_progressPageUri()); } Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.prototype = { _m_Manager$1: null, _m_PostBack$1: null, _m_Timeout$1: null, _m_Request$1: null, _m_Element$1: null, _m_Cancelled$1: false, beginProcess: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$beginProcess() { this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._progressCallback$1), Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._initiaL_DELAY$1); }, endProcess: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$endProcess() { if (this._m_Timeout$1 != null) { this._m_Timeout$1.cancel(); this._m_Timeout$1 = null; } if (this._m_Request$1 != null) { this._m_Request$1.abort(); this._m_Request$1 = null; } if (this._m_Element$1 != null) { this._m_Element$1.parentNode.removeChild(this._m_Element$1); this._m_Element$1 = null; } this._m_Cancelled$1 = true; }, _progressCallback$1: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$_progressCallback$1() { /// /// Callback for the progress timeout. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Request$1); this._m_Request$1 = new XMLHttpRequest(); this._m_Request$1.open('GET', this._m_Manager$1.get_progressPageUri() + '&rqid=' + this._m_PostBack$1.get_uniqueID(), true); this._m_Request$1.onreadystatechange = Delegate.create(this, this._requestCallback$1); this._m_Request$1.send(null); }, _requestCallback$1: function Coveo_CNL_Web_Scripts_Ajax_AjaxProgressScript$_requestCallback$1() { /// /// Callback for request events. /// if (this._m_Request$1.readyState === 4) { if (this._m_Element$1 != null) { this._m_Element$1.parentNode.removeChild(this._m_Element$1); this._m_Element$1 = null; } if (this._m_Request$1.status === 200 && this._m_Request$1.responseText !== '') { this._m_Element$1 = document.createElement('div'); this._m_Element$1.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Element$1); document.body.appendChild(this._m_Element$1); var table = document.createElement('table'); table.style.width = '100%'; table.style.height = '100%'; var row = table.insertRow(0); var cell = row.insertCell(0); cell.align = 'center'; cell.valign = 'middle'; this._m_Element$1.appendChild(table); var div = document.createElement('div'); div.innerHTML = this._m_Request$1.responseText; cell.appendChild(div); } else if (this._m_Request$1.status === 200) { } else { Coveo.CNL.Web.Scripts.CNLAssert.fail(); } this._m_Request$1 = null; if (!this._m_Cancelled$1) { this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._progressCallback$1), Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._polL_DELAY$1); } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.DropDownContentController Coveo.CNL.Web.Scripts.Ajax.DropDownContentController = function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController() { /// /// Client side code for a drop down content controler control. /// /// /// /// /// The drop down element. /// /// /// The hot spot element. /// /// /// The element to display on hot spot. /// Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.constructBase(this); } Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.prototype = { _m_OnLeaveManyEvent$1: null, m_DropDown: null, m_HotSpot: null, m_DisplayOnHotSpotOver: null, initialize: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown); this.m_HotSpot.attachEvent('onclick', Delegate.create(this, this._hotSpot_OnClick$1)); this.m_DropDown.attachEvent('onclick', Delegate.create(this, this._dropDown_OnClick$1)); if (this.m_DisplayOnHotSpotOver != null) { this.m_HotSpot.attachEvent('onmouseover', Delegate.create(this, this._hotSpot_OnMouseOver$1)); this.m_HotSpot.attachEvent('onmouseout', Delegate.create(this, this._hotSpot_OnMouseOut$1)); } }, tearDown: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$tearDown() { this.m_HotSpot.detachEvent('onclick', Delegate.create(this, this._hotSpot_OnClick$1)); this.m_DropDown.detachEvent('onclick', Delegate.create(this, this._dropDown_OnClick$1)); if (this.m_DisplayOnHotSpotOver != null) { this.m_HotSpot.detachEvent('onmouseover', Delegate.create(this, this._hotSpot_OnMouseOver$1)); this.m_HotSpot.detachEvent('onmouseout', Delegate.create(this, this._hotSpot_OnMouseOut$1)); } this.m_DropDown = null; this.m_HotSpot = null; this.m_DisplayOnHotSpotOver = null; }, _hotSpot_OnMouseOver$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnMouseOver$1() { /// /// Called when the hot spot has a mouse over. /// this.m_DisplayOnHotSpotOver.style.display = 'inline'; Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer(); }, _hotSpot_OnMouseOut$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnMouseOut$1() { /// /// Called when the hot spot has a mouse out. /// this.m_DisplayOnHotSpotOver.style.display = 'none'; Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer(); }, _hotSpot_OnClick$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hotSpot_OnClick$1() { /// /// Called when the hot spot is clicked. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_HotSpot); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_DropDown); if (this.m_DropDown.style.display === 'none') { if (this._m_OnLeaveManyEvent$1 == null) { this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ this.m_HotSpot, this.m_DropDown ], 200, Delegate.create(this, this._hide$1)); } else { this._m_OnLeaveManyEvent$1.attach([ this.m_HotSpot, this.m_DropDown ], 200, Delegate.create(this, this._hide$1)); } this._display$1(); } else { this._hide$1(); } }, _dropDown_OnClick$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_dropDown_OnClick$1() { /// /// Called when the drop down is clicked. /// if (window.event.srcElement !== this.m_DropDown) { this._hide$1(); } }, _display$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_display$1() { /// /// Displays the drop down. /// this.m_DropDown.style.position = 'absolute'; this.m_DropDown.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); this.m_DropDown.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this.m_DropDown, this.m_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft); Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer(); }, _hide$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownContentController$_hide$1() { /// /// Hides the drop down. /// if (this.m_DropDown.style.display === 'block') { this.m_DropDown.style.display = 'none'; this._m_OnLeaveManyEvent$1.dispose(); Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler = function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler() { /// /// Client side code for a menu controler control. /// /// /// /// /// /// /// this._m_DropDownsByHotSpotID$1 = {}; Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.constructBase(this); } Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.prototype = { _m_OnLeaveManyEvent$1: null, _m_LastMenuDisplayed$1: null, initialize: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_DropDownsByHotSpotID$1); }, tearDown: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$tearDown() { this._m_DropDownsByHotSpotID$1 = null; }, addMenuDropdown: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$addMenuDropdown(p_HotSpotID, p_DropDownID) { /// /// /// /// this._m_DropDownsByHotSpotID$1[p_HotSpotID] = p_DropDownID; var hotSpot = document.getElementById(p_HotSpotID); var dropDown = document.getElementById(p_DropDownID); hotSpot.attachEvent('onmouseover', Delegate.create(this, this._hotSpot_MouseOver$1)); }, _hotSpot_MouseOver$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_hotSpot_MouseOver$1() { var hotSpot = null; var dropDown = null; var $dict1 = this._m_DropDownsByHotSpotID$1; for (var $key2 in $dict1) { var entry = { key: $key2, value: $dict1[$key2] }; hotSpot = document.getElementById(entry.key); if (hotSpot.contains(window.event.srcElement)) { break; } } Coveo.CNL.Web.Scripts.CNLAssert.notNull(hotSpot); dropDown = document.getElementById(this._m_DropDownsByHotSpotID$1[hotSpot.id].toString()); Coveo.CNL.Web.Scripts.CNLAssert.notNull(dropDown); if (this._m_LastMenuDisplayed$1 !== dropDown) { if (this._m_OnLeaveManyEvent$1 == null) { this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ hotSpot, dropDown ], 300, Delegate.create(this, this._onTimeout$1)); } else { this._m_OnLeaveManyEvent$1.dispose(); this._m_OnLeaveManyEvent$1.attach([ hotSpot, dropDown ], 300, Delegate.create(this, this._onTimeout$1)); } this._display$1(hotSpot, dropDown); } }, _onTimeout$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_onTimeout$1() { var $dict1 = this._m_DropDownsByHotSpotID$1; for (var $key2 in $dict1) { var entry = { key: $key2, value: $dict1[$key2] }; var dropDown = document.getElementById(entry.value.toString()); dropDown.style.display = 'none'; } this._m_LastMenuDisplayed$1 = null; }, _display$1: function Coveo_CNL_Web_Scripts_Ajax_DropDownMenuControler$_display$1(p_HotSpot, p_DropDown) { /// /// /// /// if (this._m_LastMenuDisplayed$1 != null) { this._m_LastMenuDisplayed$1.style.display = 'none'; } p_DropDown.style.position = 'absolute'; p_DropDown.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); p_DropDown.style.display = 'block'; Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(p_DropDown, p_HotSpot, Coveo.CNL.Web.Scripts.PositionEnum.belowLeft); this._m_LastMenuDisplayed$1 = p_DropDown; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript = function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript(p_Data) { /// /// Allows specifying options on how a partial postback should be performed. /// /// /// Postback options serialized by the server. /// /// /// /// /// /// /// /// /// var deserializer = new Coveo.CNL.Web.Scripts.StringDeserializer(p_Data); this._m_ForcePartialPostback = deserializer.getBool(); this._m_SendControlData = deserializer.getBool(); this._m_TriggerFeedbacks = deserializer.getBool(); this._m_IgnoreResults = deserializer.getBool(); } Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript.prototype = { _m_ForcePartialPostback: false, _m_SendControlData: true, _m_TriggerFeedbacks: true, _m_IgnoreResults: false, get_forcePartialPostback: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_forcePartialPostback() { /// /// Whether to force a partial postback. /// /// return this._m_ForcePartialPostback; }, get_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_sendControlData() { /// /// Whether control data should be sent along with the postback. /// /// return this._m_SendControlData; }, get_triggerFeedbacks: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_triggerFeedbacks() { /// /// Whether applicable feedbacks should be triggered. /// /// return this._m_TriggerFeedbacks; }, get_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$get_ignoreResults() { /// /// Whether to ignore the results of the request. /// /// return this._m_IgnoreResults; }, set_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PostbackOptionsScript$set_ignoreResults(value) { /// /// Whether to ignore the results of the request. /// /// this._m_IgnoreResults = value; return value; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack = function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack(p_Target) { /// /// Feedback that is triggered when some job is processing. /// Used for links, it changes the link text for "Processing ..." /// /// /// The target control of the feedback. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.constructBase(this); this._m_Target$2 = p_Target; } Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.prototype = { _m_Target$2: null, _m_ProcessingElement$2: null, _m_Timeout$2: null, _m_state$2: 0, _m_displaySetting$2: null, beginFeedback: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$beginFeedback() { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); this._m_displaySetting$2 = this._m_Target$2.style.display; this._m_Target$2.style.display = 'none'; this._m_ProcessingElement$2 = document.createElement('span'); this._m_ProcessingElement$2.innerText = Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.PROCESSING + ' . '; this._m_Target$2.parentNode.insertBefore(this._m_ProcessingElement$2, this._m_Target$2); }, endFeedback: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$endFeedback() { this._m_Timeout$2.cancel(); this._m_Target$2.parentNode.removeChild(this._m_ProcessingElement$2); this._m_Target$2.style.display = this._m_displaySetting$2; }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_ProcessingFeedBack$_timerCallback$2() { /// /// Callback for the timer we use. /// switch (this._m_state$2) { case 0: this._m_ProcessingElement$2.innerText = Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.PROCESSING + ' . '; ++this._m_state$2; break; case 1: this._m_ProcessingElement$2.innerText = Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.PROCESSING + ' .. '; ++this._m_state$2; break; case 2: this._m_ProcessingElement$2.innerText = Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.PROCESSING + ' ...'; this._m_state$2 = 0; break; default: Coveo.CNL.Web.Scripts.CNLAssert.fail(); break; } this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack._framE_DELAY$2); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.Profiler Coveo.CNL.Web.Scripts.Ajax.Profiler = function Coveo_CNL_Web_Scripts_Ajax_Profiler() { /// /// Allows profiling client side operations. /// /// /// /// /// /// /// /// /// this._m_Start = Date.get_now(); this._m_Messages = []; Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = this; } Coveo.CNL.Web.Scripts.Ajax.Profiler.log = function Coveo_CNL_Web_Scripts_Ajax_Profiler$log(p_Message) { /// /// Logs an event to the current instance of . /// /// /// The message of the event to log. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Message); if (Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current != null) { Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current._logInternal(p_Message); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.prototype = { stop: function Coveo_CNL_Web_Scripts_Ajax_Profiler$stop() { /// /// Stops the profiling and displays the results. /// Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Profiling stopped.'); if (Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results != null) { Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results.parentNode.removeChild(Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results); } var results = document.createElement('div'); results.style.position = 'absolute'; results.style.left = '10px'; results.style.top = '10px'; results.style.padding = '5px'; results.style.border = '1px solid black'; results.style.backgroundColor = 'white'; results.style.zIndex = 999; results.style.fontFamily = 'Tahoma'; results.style.fontSize = '8pt'; var $enum1 = this._m_Messages.getEnumerator(); while ($enum1.moveNext()) { var msg = $enum1.get_current(); var div = document.createElement('div'); div.innerHTML = msg; results.appendChild(div); } document.body.appendChild(results); Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results = results; Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = null; }, _logInternal: function Coveo_CNL_Web_Scripts_Ajax_Profiler$_logInternal(p_Message) { /// /// Logs an event. /// /// /// The message of the event to log. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Message); var delta = Date.get_now().getTime() - this._m_Start.getTime(); this._m_Messages.add('+' + delta.toString() + ' - ' + p_Message); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.PercentTimer Coveo.CNL.Web.Scripts.Ajax.PercentTimer = function Coveo_CNL_Web_Scripts_Ajax_PercentTimer(p_Duration) { /// /// Allows computing the percentage of a process that must last a specific amount of time. /// /// /// The duration of the process (in milliseconds). /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Duration > 0); this._m_Duration = p_Duration; } Coveo.CNL.Web.Scripts.Ajax.PercentTimer.prototype = { _m_Duration: 0, _m_Start: null, _m_Started: false, ensureStarted: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$ensureStarted() { /// /// Ensures that the timer is started. /// if (!this._m_Started) { this._m_Start = Date.get_now(); this._m_Started = true; } }, getPercentage: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$getPercentage() { /// /// Computes the current percentage. /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Started); var delta = Date.get_now().getTime() - this._m_Start.getTime(); return (delta < this._m_Duration) ? delta / this._m_Duration : 1; }, isFinished: function Coveo_CNL_Web_Scripts_Ajax_PercentTimer$isFinished() { /// /// Checks if the process should be finished. /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Started); return this.getPercentage() >= 1; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger = function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger(p_Flipper, p_Info) { /// /// Pseudo transition effect that displays why a control or region is being updated. /// /// /// The that flips the content. /// /// /// The information to display on the content. /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Info); this._m_Flipper$2 = p_Flipper; this._m_Info$2 = p_Info; } Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.prototype = { _m_Flipper$2: null, _m_Info$2: null, _m_Overlay$2: null, _m_Timeout$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$beginTransition() { var elem = this._m_Flipper$2.flip(); this._m_Overlay$2 = document.createElement('div'); this._m_Overlay$2.style.position = 'absolute'; this._m_Overlay$2.style.zIndex = 999; this._m_Overlay$2.style.border = '2px solid red'; this._m_Overlay$2.style.padding = '5px'; document.body.appendChild(this._m_Overlay$2); Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(elem)); var info = document.createElement('span'); info.style.fontFamily = 'verdana'; info.style.fontWeight = 'bold'; info.style.fontSize = '8pt'; info.style.color = 'white'; info.style.backgroundColor = 'black'; info.innerText = this._m_Info$2; this._m_Overlay$2.appendChild(info); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger._displaY_DELAY$2); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Overlay$2.parentNode.removeChild(this._m_Overlay$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_UpdateDebugger$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Timeout$2 = null; this.terminate(); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition = function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition(p_Element, p_Flipper) { /// /// Transition effect that flips in the new content and gradually fades it in. /// /// /// The that we flip. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_Overlay$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$beginTransition() { if (!Coveo.CNL.Web.Scripts.Browser.get_isIE()) { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Flipper$2.get_newContent(), 0); } this._m_Element$2 = this._m_Flipper$2.flip(); if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { this._m_Overlay$2 = document.createElement('div'); this._m_Overlay$2.style.backgroundColor = 'white'; this._m_Overlay$2.style.position = 'absolute'; this._m_Overlay$2.style.zIndex = 999; document.body.appendChild(this._m_Overlay$2); Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2)); } this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(100); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { document.body.removeChild(this._m_Overlay$2); } else { this._m_Element$2.style.opacity = ''; } }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FlipFadeTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, 1 - this._m_Percent$2.getPercentage()); } else { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage()); } if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.IdMappings Coveo.CNL.Web.Scripts.Ajax.IdMappings = function Coveo_CNL_Web_Scripts_Ajax_IdMappings() { /// /// Implements a dictionary of mappings from a control id (and it's childs) to an object. /// /// /// this._m_Mappings = {}; } Coveo.CNL.Web.Scripts.Ajax.IdMappings.prototype = { add: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$add(p_Id, p_Value) { /// /// Adds a mapping to the list. /// /// /// The id for the mapping. /// /// /// The object to which it is mapped. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); this._m_Mappings[p_Id] = p_Value; }, remove: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$remove(p_Id) { /// /// Remvoes a mapping from the list. /// /// /// The id for the mapping. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); delete this._m_Mappings[p_Id]; }, get: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$get(p_Id) { /// /// Gets the mapped value for an id. /// /// /// The id for which to retrieve the mapped value. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); var value = null; var matched = null; var $dict1 = this._m_Mappings; for (var $key2 in $dict1) { var entry = { key: $key2, value: $dict1[$key2] }; if ((matched == null || entry.key.length > matched.length) && p_Id.startsWith(entry.key)) { value = entry.value; } } return value; }, clear: function Coveo_CNL_Web_Scripts_Ajax_IdMappings$clear() { /// /// Clears the mappings. /// Object.clearKeys(this._m_Mappings); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.Feedback Coveo.CNL.Web.Scripts.Ajax.Feedback = function Coveo_CNL_Web_Scripts_Ajax_Feedback() { /// /// Base class for all feedbacks. /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.Feedback.constructBase(this); } Coveo.CNL.Web.Scripts.Ajax.Feedback.create = function Coveo_CNL_Web_Scripts_Ajax_Feedback$create(p_Id, p_Type, p_Target, p_Fullscreen) { /// /// Creates a object. /// /// /// The id of the element. /// /// /// The type of the feedback. /// /// /// The target control of the feedback. /// /// /// Whether to display the feedback in fullscreen mode. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Type); var feedback; switch (p_Type) { case 'Blank': feedback = new Coveo.CNL.Web.Scripts.Ajax.BlankFeedback(document.getElementById(p_Id), p_Fullscreen); break; case 'Processing': Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); feedback = new Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack(document.getElementById(p_Target)); break; default: Coveo.CNL.Web.Scripts.CNLAssert.fail(); feedback = new Coveo.CNL.Web.Scripts.Ajax.BlankFeedback(document.getElementById(p_Id), p_Fullscreen); break; } return feedback; } Coveo.CNL.Web.Scripts.Ajax.Feedback.prototype = { _m_Timeout$1: null, beginProcess: function Coveo_CNL_Web_Scripts_Ajax_Feedback$beginProcess() { this._m_Timeout$1 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$1), Coveo.CNL.Web.Scripts.Ajax.Feedback._initiaL_DELAY$1); }, endProcess: function Coveo_CNL_Web_Scripts_Ajax_Feedback$endProcess() { if (this._m_Timeout$1 != null) { this._m_Timeout$1.cancel(); this._m_Timeout$1 = null; } else { this.endFeedback(); } }, _timerCallback$1: function Coveo_CNL_Web_Scripts_Ajax_Feedback$_timerCallback$1() { /// /// Callback for the timer we use. /// this._m_Timeout$1 = null; this.beginFeedback(); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.FadeInTransition Coveo.CNL.Web.Scripts.Ajax.FadeInTransition = function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition(p_Element, p_Flipper) { /// /// Transition effect that fades in the new content. /// /// /// The that we flip. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$beginTransition() { this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(650); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, 1); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FadeInTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); if (!this._m_Percent$2.isFinished()) { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage()); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FadeInTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.TransitionEffect Coveo.CNL.Web.Scripts.Ajax.TransitionEffect = function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect() { /// /// Base class for all transition effects. /// Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.constructBase(this); } Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create = function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$create(p_Content, p_Flipper, p_Effect) { /// /// Creates a object. /// /// /// The object to flip. /// /// /// The object to that performs the flip. /// /// /// The name of the effect to create. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Content); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Effect); var effect; switch (p_Effect) { case 'None': effect = new Coveo.CNL.Web.Scripts.Ajax.FlipTransition(p_Flipper); break; case 'Expand': effect = new Coveo.CNL.Web.Scripts.Ajax.ExpandTransition(p_Flipper); break; case 'HExpand': effect = new Coveo.CNL.Web.Scripts.Ajax.HExpandTransition(p_Flipper); break; case 'Collapse': effect = new Coveo.CNL.Web.Scripts.Ajax.CollapseTransition(p_Content, p_Flipper); break; case 'HCollapse': effect = new Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition(p_Content, p_Flipper); break; case 'Adjust': effect = new Coveo.CNL.Web.Scripts.Ajax.AdjustTransition(p_Content, p_Flipper); break; case 'HAdjust': effect = new Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition(p_Content, p_Flipper); break; case 'FadeIn': effect = new Coveo.CNL.Web.Scripts.Ajax.FadeInTransition(p_Content, p_Flipper); break; case 'FadeFlip': effect = new Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition(p_Content, p_Flipper); break; case 'FlipFade': effect = new Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition(p_Content, p_Flipper); break; default: Coveo.CNL.Web.Scripts.CNLAssert.fail(); effect = new Coveo.CNL.Web.Scripts.Ajax.FlipTransition(p_Flipper); break; } return effect; } Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.prototype = { beginProcess: function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$beginProcess() { this.beginTransition(); }, endProcess: function Coveo_CNL_Web_Scripts_Ajax_TransitionEffect$endProcess() { this.endTransition(); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect = function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect(p_Element) { /// /// Effect that gradually fades in an element. /// /// /// The that we fade in. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); this._m_Element$2 = p_Element; } Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.prototype = { _m_Element$2: null, _m_Duration$2: 200, _m_TargetOpacity$2: 1, _m_Timeout$2: null, _m_Percent$2: null, get_duration: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$get_duration() { /// /// The duration of the effect in milliseconds. /// /// return this._m_Duration$2; }, set_duration: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$set_duration(value) { /// /// The duration of the effect in milliseconds. /// /// this._m_Duration$2 = value; return value; }, get_targetOpacity: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$get_targetOpacity() { /// /// The target opacity of the element. /// /// return this._m_TargetOpacity$2; }, set_targetOpacity: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$set_targetOpacity(value) { /// /// The target opacity of the element. /// /// this._m_TargetOpacity$2 = value; return value; }, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$beginTransition() { this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(this._m_Duration$2); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_TargetOpacity$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_GradualFadeInEffect$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, this._m_Percent$2.getPercentage() * this._m_TargetOpacity$2); if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper = function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper() { /// /// Wraps a object to make it an . /// /// /// /// /// this._m_Uris$1 = []; Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.constructBase(this); } Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.prototype = { _m_Loader$1: null, add: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$add(p_Uri) { /// /// Adds the uri of a script to load. /// /// /// The uri of the script to load. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); this._m_Uris$1.add(p_Uri); }, beginProcess: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$beginProcess() { Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Loader$1); var uris = new Array(this._m_Uris$1.length); for (var i = 0; i < this._m_Uris$1.length; ++i) { uris[i] = this._m_Uris$1[i]; } this._m_Loader$1 = new ScriptLoader(uris); this._m_Loader$1.load(false, 0, Delegate.create(this, this._scriptsLoadedCallback$1), Delegate.create(this, this._scriptsLoadedCallback$1)); }, endProcess: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$endProcess() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Loader$1); this._m_Loader$1.dispose(); this._m_Loader$1 = null; }, _scriptsLoadedCallback$1: function Coveo_CNL_Web_Scripts_Ajax_ScriptLoaderWrapper$_scriptsLoadedCallback$1(p_Sender, p_Args) { /// /// Callback for when all scripts are loaded. /// /// /// /// /// this.terminate(); } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.ModalBox Coveo.CNL.Web.Scripts.Ajax.ModalBox = function Coveo_CNL_Web_Scripts_Ajax_ModalBox(p_Manager, p_Id, p_Content, p_Width, p_Height, p_HorizontalMargin, p_VerticalMargin, p_EnableOutsideClick) { /// /// Encapsulates modal dialog box displayed on the page. /// /// /// The object. /// /// /// The unique identifier of the modal box. /// /// /// The html content of the box. /// /// /// The width of the box. /// /// /// The height of the box. /// /// /// The horizontal margin from the border of the window. /// /// /// The vertical margin from the border of the window. /// /// /// Whether the OutsideClick event should be fiered. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Content); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Width !== 0 || (p_HorizontalMargin + p_VerticalMargin) !== 0); Coveo.CNL.Web.Scripts.CNLAssert.check(!(p_Height !== 0 && (p_HorizontalMargin + p_VerticalMargin) !== 0)); this._m_Manager = p_Manager; this._m_Id = p_Id; this._m_Content = p_Content; this._m_Width = p_Width; this._m_Height = p_Height; this._m_HorizontalMargin = p_HorizontalMargin; this._m_VerticalMargin = p_VerticalMargin; this._m_EnableOutsideClick = p_EnableOutsideClick; } Coveo.CNL.Web.Scripts.Ajax.ModalBox.prototype = { _m_Manager: null, _m_Id: null, _m_Content: null, _m_Width: 0, _m_Height: 0, _m_HorizontalMargin: 0, _m_VerticalMargin: 0, _m_Dimmer: null, _m_Container: null, _m_Frame: null, _m_InitialOverflow: null, _m_EnableOutsideClick: false, _m_IFrame: null, get_id: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$get_id() { /// /// The unique identifier for the modal box. /// /// return this._m_Id; }, get_visible: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$get_visible() { /// /// This property is true when the box is visible. /// /// return this._m_Frame != null; }, show: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$show() { /// /// Shows the modal box. /// Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_visible()); if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); this._m_InitialOverflow = document.documentElement.style.overflow; document.documentElement.style.overflow = 'hidden'; document.documentElement.scrollLeft = scroll.width; document.documentElement.scrollTop = scroll.height; } else { var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); this._m_InitialOverflow = document.body.style.overflow; document.body.style.overflow = 'hidden'; document.body.scrollLeft = scroll.width; document.body.scrollTop = scroll.height; } if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { this._m_IFrame = document.createElement('iframe'); this._m_IFrame.getAttributeNode('src').value = 'javascript:false;'; this._m_IFrame.getAttributeNode('scrolling').value = 'no'; this._m_IFrame.style.position = 'absolute'; this._m_IFrame.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); this._m_IFrame.style.display = 'none'; this._m_IFrame.style.border = '0'; this._m_IFrame.style.display = 'block'; this._m_IFrame.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'; Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_IFrame); document.body.appendChild(this._m_IFrame); } this._m_Dimmer = document.createElement('div'); Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Dimmer); this._m_Dimmer.style.backgroundColor = 'silver'; this._m_Dimmer.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Dimmer, 0.75); this._m_Manager.get_form().appendChild(this._m_Dimmer); this._m_Container = document.createElement('div'); Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow(this._m_Container); this._m_Container.style.zIndex = (Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex() + 1); this._m_Manager.get_form().appendChild(this._m_Container); var table = document.createElement('table'); table.style.width = '100%'; table.style.height = '100%'; var row = table.insertRow(0); var cell = row.insertCell(0); cell.align = 'center'; this._m_Container.appendChild(table); if (this._m_EnableOutsideClick) { this._m_Container.attachEvent('onclick', Delegate.create(this, this._container_Click)); this._m_Container.style.cursor = 'pointer'; } this._m_Frame = document.createElement('div'); if (this._m_Width !== 0) { this._m_Frame.style.width = this._m_Width + 'px'; if (this._m_Height !== 0) { this._m_Frame.style.height = this._m_Height + 'px'; } } else { var size = Coveo.CNL.Web.Scripts.DOMUtilities.getWindowSize(); this._m_Frame.style.width = (size.width - this._m_HorizontalMargin * 2) + 'px'; this._m_Frame.style.height = (size.height - this._m_VerticalMargin * 2) + 'px'; } this._m_Frame.style.textAlign = 'left'; this._m_Frame.style.border = '3px solid gray'; this._m_Frame.style.backgroundColor = 'white'; this._m_Frame.style.cursor = 'auto'; cell.appendChild(this._m_Frame); this._m_Frame.innerHTML = this._m_Content; }, close: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$close() { /// /// Closes the modal box. /// Coveo.CNL.Web.Scripts.CNLAssert.check(this.get_visible()); Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Dimmer); if (Coveo.CNL.Web.Scripts.Browser.get_isIE6()) { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_IFrame); this._m_IFrame.parentNode.removeChild(this._m_IFrame); this._m_IFrame = null; } this._m_Dimmer.parentNode.removeChild(this._m_Dimmer); this._m_Dimmer = null; if (this._m_Container != null) { this._m_Container.parentNode.removeChild(this._m_Container); this._m_Container = null; this._m_Frame = null; } if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { document.documentElement.style.overflow = this._m_InitialOverflow; } else { document.body.style.overflow = this._m_InitialOverflow; } Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_visible()); }, _container_Click: function Coveo_CNL_Web_Scripts_Ajax_ModalBox$_container_Click() { if (!this._m_Frame.contains(window.event.srcElement)) { this._m_Manager.doPostBack(this._m_Id, '', false); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.FlipTransition Coveo.CNL.Web.Scripts.Ajax.FlipTransition = function Coveo_CNL_Web_Scripts_Ajax_FlipTransition(p_Flipper) { /// /// Transition effect that only flips the content. /// /// /// The that flips the content. /// /// /// Coveo.CNL.Web.Scripts.Ajax.FlipTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.FlipTransition.prototype = { _m_Flipper$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipTransition$beginTransition() { this._m_Flipper$2.flip(); this.terminate(); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_FlipTransition$endTransition() { } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager = function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager() { /// /// Runs a list of asynchronous processes, and provides a notification when they are done. /// /// /// /// /// this._m_Processes = []; } Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager.prototype = { _m_Callback: null, add: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$add(p_Process) { /// /// Adds a process to the list. /// /// /// The to add. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Process); p_Process.set_manager(this); this._m_Processes.add(p_Process); }, startAll: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$startAll(p_Callback) { /// /// Starts running the asynchronous processes. /// /// /// Callback function to call when done. /// this._m_Callback = p_Callback; if (this._m_Processes.length > 0) { var processes = this._m_Processes.clone(); var $enum1 = processes.getEnumerator(); while ($enum1.moveNext()) { var process = $enum1.get_current(); process.start(); } } else { if (this._m_Callback != null) { this._m_Callback.invoke(this, EventArgs.Empty); } } }, terminateAll: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$terminateAll() { /// /// Stops all the processes. /// var processes = this._m_Processes.clone(); var $enum1 = processes.getEnumerator(); while ($enum1.moveNext()) { var process = $enum1.get_current(); process.terminate(); } Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Processes.length === 0); }, processIsDone: function Coveo_CNL_Web_Scripts_Ajax_AsynchronousProcessManager$processIsDone(p_Process) { /// /// Called whenever a process finishes. /// /// /// The process that signals it is done. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Process); Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_Processes.contains(p_Process)); this._m_Processes.remove(p_Process); if (this._m_Processes.length === 0 && this._m_Callback != null) { this._m_Callback.invoke(this, EventArgs.Empty); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition = function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition(p_Element, p_Flipper) { /// /// Transition effect that fades out the old content and then flips in the new one. /// /// /// The that we flip. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_Overlay$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$beginTransition() { if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { this._m_Overlay$2 = document.createElement('div'); this._m_Overlay$2.style.backgroundColor = 'white'; this._m_Overlay$2.style.position = 'absolute'; this._m_Overlay$2.style.zIndex = 999; document.body.appendChild(this._m_Overlay$2); Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds(this._m_Overlay$2, Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(this._m_Element$2)); } this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(150); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { this._m_Element$2 = this._m_Flipper$2.flip(); document.body.removeChild(this._m_Overlay$2); } else { this._m_Element$2 = this._m_Flipper$2.flip(); this._m_Element$2.style.opacity = ''; } }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_FadeFlipTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Overlay$2, this._m_Percent$2.getPercentage()); } else { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Element$2, 1 - this._m_Percent$2.getPercentage()); } if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition = function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition(p_Element, p_Flipper) { /// /// Transition effect that gradually adjusts the size of an element horizontally. /// /// /// The that we adjust. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_InitialWidth$2: 0, _m_Offset$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$beginTransition() { this._m_InitialWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width; this._m_Element$2 = this._m_Flipper$2.flip(); this._m_Offset$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width - this._m_InitialWidth$2; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.width = this._m_InitialWidth$2 + 'px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HAdjustTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.width = ((this._m_InitialWidth$2 + this._m_Offset$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition = function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition(p_Element, p_Flipper) { /// /// Transition effect that collapses a tag horizontally from it's normal size to nothing. /// /// /// The that we collapse. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Element$2 = p_Element; this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_InitialWidth$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$beginTransition() { this._m_InitialWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.width = this._m_InitialWidth$2 + 'px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Flipper$2.flip(), this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HCollapseTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.width = ((this._m_InitialWidth$2 * Math.cos(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.HExpandTransition Coveo.CNL.Web.Scripts.Ajax.HExpandTransition = function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition(p_Flipper) { /// /// Transition effect that expands a tag horizontally from nothing to it's normal size. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_TargetWidth$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$beginTransition() { this._m_Element$2 = this._m_Flipper$2.flip(); this._m_TargetWidth$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).width; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.width = '0px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_HExpandTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.width = ((this._m_TargetWidth$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.HExpandTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.ExpandTransition Coveo.CNL.Web.Scripts.Ajax.ExpandTransition = function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition(p_Flipper) { /// /// Transition effect that expands a tag from nothing to it's normal size. /// /// /// The that flips the content. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.constructBase(this); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Flipper); this._m_Flipper$2 = p_Flipper; } Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.prototype = { _m_Flipper$2: null, _m_Element$2: null, _m_TargetHeight$2: 0, _m_Margins$2: null, _m_Container$2: null, _m_Timeout$2: null, _m_Percent$2: null, beginTransition: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$beginTransition() { this._m_Element$2 = this._m_Flipper$2.flip(); this._m_Element$2.style.display = 'block'; this._m_TargetHeight$2 = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Element$2).height; this._m_Container$2 = document.createElement('div'); this._m_Container$2.style.overflow = 'hidden'; this._m_Container$2.style.height = '0px'; this._m_Margins$2 = new Coveo.CNL.Web.Scripts.TransferMargin(this._m_Element$2, this._m_Container$2); this._m_Element$2.parentNode.replaceChild(this._m_Container$2, this._m_Element$2); this._m_Container$2.appendChild(this._m_Element$2); this._m_Percent$2 = new Coveo.CNL.Web.Scripts.Ajax.PercentTimer(300); this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), 0); }, endTransition: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$endTransition() { if (this._m_Timeout$2 != null) { this._m_Timeout$2.cancel(); this._m_Timeout$2 = null; } this._m_Margins$2.restore(); this._m_Container$2.parentNode.replaceChild(this._m_Element$2, this._m_Container$2); }, _timerCallback$2: function Coveo_CNL_Web_Scripts_Ajax_ExpandTransition$_timerCallback$2() { /// /// Callback for the timer we use. /// this._m_Percent$2.ensureStarted(); this._m_Container$2.style.height = ((this._m_TargetHeight$2 * Math.sin(Math.PI * this._m_Percent$2.getPercentage() / 2))).toString() + 'px'; if (!this._m_Percent$2.isFinished()) { this._m_Timeout$2 = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._timerCallback$2), Coveo.CNL.Web.Scripts.Ajax.ExpandTransition._framE_DELAY$2); } else { this.terminate(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.RegionFlipper Coveo.CNL.Web.Scripts.Ajax.RegionFlipper = function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper(p_Region, p_Content) { /// /// Implementation of for flipping regions. /// /// /// The of the region to flip. /// /// /// The new content of the region. /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Region); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Content); this._m_Region = p_Region; this._m_Content = p_Content; } Coveo.CNL.Web.Scripts.Ajax.RegionFlipper.prototype = { _m_Region: null, _m_Content: null, get_newContent: function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper$get_newContent() { /// return this._m_Region; }, flip: function Coveo_CNL_Web_Scripts_Ajax_RegionFlipper$flip() { /// this._m_Region.innerHTML = this._m_Content; return this._m_Region; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.PartialPostBack Coveo.CNL.Web.Scripts.Ajax.PartialPostBack = function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack(p_Manager, p_Target, p_Argument, p_Feedbacks, p_Preemptive) { /// /// Encapsulates a partial postback to the server. /// /// /// The object. /// /// /// The id of the target control. /// /// /// The postback arguments. /// /// /// The feedbacks to display. /// /// /// Whether this is a preemptive postback. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// The name of the http header sent to identify partial postbacks. /// /// /// The name of the http header sent to identify postbacks made from a bootstraped interface. /// /// /// The name of the http header sent to identify history state value. /// /// /// The name of the http header sent to signal that the page control data hasn't been sent. /// /// /// The name of the hidden input holding the event target. /// /// /// The name of the hidden input holding the event argument. /// /// /// The name of the hidden input holding the viewstate. /// /// /// The name of the hidden input indicating that the viewstate is encrypted. /// /// /// The name of the hidden input holding the form request digest. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Manager); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Feedbacks); this._m_Manager = p_Manager; this._m_Target = p_Target; this._m_Argument = p_Argument; this._m_Feedbacks = p_Feedbacks; this._m_Preemptive = p_Preemptive; this._m_UniqueID = (Math.random() * 1000000000).toString(16); if (this._m_Manager.get_enableProfiling()) { this._m_Profiler = new Coveo.CNL.Web.Scripts.Ajax.Profiler(); } } Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.prototype = { _m_Manager: null, _m_Target: null, _m_Argument: null, _m_Feedbacks: null, _m_Preemptive: false, _m_SendControlData: true, _m_Callback: null, _m_IgnoreResults: false, _m_EnableProgress: true, _m_UniqueID: null, _m_Request: null, _m_Response: null, _m_ReturnValue: null, _m_RequestCompleted: false, _m_Cancelling: false, _m_PreRequestProcesses: null, _m_PostRequestProcesses: null, _m_Profiler: null, get_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_sendControlData() { /// /// Whether to send the form's control data. /// /// return this._m_SendControlData; }, set_sendControlData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_sendControlData(value) { /// /// Whether to send the form's control data. /// /// this._m_SendControlData = value; return value; }, get_callback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_callback() { /// /// The callback for the postback. /// /// return this._m_Callback; }, set_callback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_callback(value) { /// /// The callback for the postback. /// /// this._m_Callback = value; return value; }, get_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_ignoreResults() { /// /// Whether to ignore the results of the postback. /// /// return this._m_IgnoreResults; }, set_ignoreResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_ignoreResults(value) { /// /// Whether to ignore the results of the postback. /// /// this._m_IgnoreResults = value; return value; }, get_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_enableProgress() { /// /// Whether postback progress tracking is enabled. /// /// return this._m_EnableProgress; }, set_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$set_enableProgress(value) { /// /// Whether postback progress tracking is enabled. /// /// this._m_EnableProgress = value; return value; }, get_uniqueID: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$get_uniqueID() { /// /// Gets the generated unique ID for the request. /// /// return this._m_UniqueID; }, execute: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$execute() { /// /// Starts the partial postback. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Request); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Preparing request...'); if (Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack) { (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE]).value = this._m_Manager.get_initialViewState(); Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack = false; } (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET]).value = this._m_Target; (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT]).value = this._m_Argument; var postBackUrl = this._m_Manager.get_form().action; var hashPos = postBackUrl.indexOf('#'); if (hashPos !== -1) { postBackUrl = postBackUrl.substr(0, hashPos); } this._m_Request = new XMLHttpRequest(); this._m_Request.open('POST', postBackUrl, true); this._m_Request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK, this._m_UniqueID); if (this._m_Manager.get_bootstrap()) { this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP, '1'); } if (!this._m_SendControlData) { this._m_Request.setRequestHeader(Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_NO_CONTROL_DATA, '1'); } this._m_Request.onreadystatechange = Delegate.create(this, this._requestCallback); this._m_Request.send(this._buildPostData()); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Request is sent.'); this._m_PreRequestProcesses = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager(); var $enum1 = this._m_Feedbacks.getEnumerator(); while ($enum1.moveNext()) { var feedback = $enum1.get_current(); this._m_PreRequestProcesses.add(feedback); } if (this._m_EnableProgress && this._m_Manager.get_enableProgress()) { this._m_PreRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript(this._m_Manager, this)); } Coveo.CNL.Web.Scripts.DOMUtilities.setOperationPendingCursor(); if (!this._m_IgnoreResults) { Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter(); } this._m_PreRequestProcesses.startAll(null); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Pre-request processes started.'); }, cancel: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$cancel() { /// /// Cancels the partial postback. /// if (!this._m_RequestCompleted) { this._m_Cancelling = true; this._m_PreRequestProcesses.terminateAll(); this._m_Request.abort(); this._m_Request = null; Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor(); if (!this._m_IgnoreResults) { Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter(); } } else { if (this._m_PostRequestProcesses != null) { this._m_PostRequestProcesses.terminateAll(); this._m_PostRequestProcesses = null; } } }, applyPreemptivePostback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$applyPreemptivePostback() { /// /// Causes a preemptive postback to apply it's result if the response has /// already been obtained, or to apply them right away when they are received. /// if (this._m_Response != null) { this._applyResults(); } else { this._m_Preemptive = false; } }, _buildPostData: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_buildPostData() { /// /// Builds the form data for the postback. /// /// var data = ''; var elements = this._m_Manager.get_form().elements; for (var i = 0; i < elements.length; ++i) { var elem = elements[i]; var name = elem.getAttribute('name'); if (isNullOrUndefined(name)) { continue; } if (!this._m_SendControlData && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE_ENCRYPTED && name !== Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_REQUEST_DIGEST && !this._m_Manager.shouldAlwaysBeSent(name)) { continue; } if (String.compare(elem.tagName, 'input', true) === 0) { var value = null; var type = elem.getAttribute('type'); if (!isNullOrUndefined(type)) { switch (type) { case 'checkbox': if (elem.checked) { value = 'on'; } break; case 'radio': if (elem.checked) { value = elem.getAttribute('value'); } break; case 'submit': case 'button': break; default: value = elem.value; break; } } if (!isNullOrUndefined(value)) { data += '&' + name + '=' + encodeURIComponent(value); } } else if (String.compare(elem.tagName, 'select', true) === 0) { var select = elem; for (var j = 0; j < select.options.length; ++j) { var option = select.options[j]; if (option.selected) { var value = (option.value != null) ? option.value : option.innerText; data += '&' + name + '=' + encodeURIComponent(option.value); } } } else if (String.compare(elem.tagName, 'textarea', true) === 0) { var textArea = elem; data += '&' + name + '=' + encodeURIComponent(textArea.value); } } return data; }, _requestCallback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_requestCallback() { /// /// Callback for request events. /// if (!this._m_Cancelling && this._m_Request.readyState === 4) { Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Response has been received.'); if (!this._m_IgnoreResults) { if (this._m_Request.status === 200) { this._m_Response = this._m_Request.responseXML; if (!this._m_Preemptive) { this._applyResults(); } } else { this._displayAjaxError(); } } this._m_PreRequestProcesses.terminateAll(); this._m_PreRequestProcesses = null; Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor(); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Pre-request processes terminated.'); this._m_Request = null; this._m_RequestCompleted = true; } }, _displayAjaxError: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_displayAjaxError() { /// /// Displays an error returned by the server and disables the page completely. /// var wellKnownError = ''; var unknownError = ''; var errorDetails = ''; if (this._m_Request.status === 500) { unknownError = 'An unexpected error occurred. Please reload the page.'; if (this._m_Request.responseText !== '') { errorDetails = this._m_Request.responseText; } else if (this._m_Request.statusText !== '') { errorDetails = 'HTTP ' + this._m_Request.status.toString() + ' ' + this._m_Request.statusText; } else { errorDetails = 'HTTP ' + this._m_Request.status.toString() + ' Unspecified error.'; } } else { wellKnownError = 'The server is unavailable at the moment.

Reload the page for more information.'; } var wellKnown = wellKnownError !== ''; Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp(); document.body.style.overflow = 'hidden'; document.documentElement.style.overflow = 'hidden'; var fader = document.createElement('div'); fader.style.backgroundColor = 'silver'; Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(fader, 0.5); fader.style.position = 'absolute'; fader.style.left = '0px'; fader.style.top = '0px'; fader.style.width = '100%'; fader.style.height = '100%'; fader.style.zIndex = 9999; document.body.appendChild(fader); var panel = document.createElement('div'); panel.style.fontFamily = 'Arial'; panel.style.fontSize = '12pt'; panel.style.padding = '15px'; panel.style.position = 'absolute'; if (wellKnown) { panel.style.border = '3px solid gray'; panel.style.backgroundColor = 'whitesmoke'; panel.style.left = '25%'; panel.style.top = '30%'; panel.style.width = '50%'; panel.style.height = '20%'; } else { panel.style.border = '3px solid red'; panel.style.backgroundColor = 'white'; panel.style.left = '25%'; panel.style.top = '25%'; panel.style.width = '50%'; panel.style.height = '50%'; } panel.style.zIndex = 10000; document.body.appendChild(panel); var insidePanel = document.createElement('div'); insidePanel.style.width = '100%'; insidePanel.style.height = '100%'; insidePanel.style.overflow = 'auto'; panel.appendChild(insidePanel); var friendlyError = document.createElement('div'); friendlyError.style.fontWeight = 'bold'; if (!wellKnown) { friendlyError.style.paddingBottom = '5px'; friendlyError.style.borderBottom = '1px solid gray'; } friendlyError.style.position = 'relative'; if (!Coveo.CNL.Web.Scripts.Browser.get_isFirefox()) { var friendlyErrorIcon = document.createElement('span'); friendlyErrorIcon.style.fontFamily = 'Wingdings'; friendlyErrorIcon.style.fontSize = '2.3em'; if (!wellKnown) { friendlyErrorIcon.innerHTML = 'M'; friendlyErrorIcon.style.color = 'Red'; } else { friendlyErrorIcon.innerHTML = 'ý'; friendlyErrorIcon.style.color = 'Gray'; } friendlyError.appendChild(friendlyErrorIcon); } var friendlyErrorText = document.createElement('div'); if (!Coveo.CNL.Web.Scripts.Browser.get_isFirefox()) { friendlyErrorText.style.position = 'absolute'; friendlyErrorText.style.top = '11px'; friendlyErrorText.style.left = '45px'; } friendlyErrorText.innerHTML = (wellKnown) ? wellKnownError : unknownError; friendlyError.appendChild(friendlyErrorText); insidePanel.appendChild(friendlyError); if (!wellKnown) { var fullError = document.createElement('div'); fullError.innerHTML = errorDetails; fullError.style.marginTop = '20px'; fullError.style.display = 'none'; fullError.style.fontSize = '0.8em'; insidePanel.appendChild(fullError); var toggle = document.createElement('div'); toggle.innerHTML = 'Click here to display the full error returned by the server.'; toggle.style.marginTop = '20px'; toggle.style.cursor = 'pointer'; insidePanel.style.fontSize = '0.9em'; toggle.attachEvent('onclick', Delegate.create(this, function() { fullError.style.display = 'block'; toggle.style.display = 'none'; panel.style.width = '90%'; panel.style.height = '90%'; panel.style.top = '10px'; panel.style.left = '5%'; })); insidePanel.appendChild(toggle); } eval('if (window.external && window.external.PostBackErrorHandler) { window.external.PostBackErrorHandler(); }'); }, _applyResults: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_applyResults() { /// /// Applies the result of the postback. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Response); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Calling ProcessXmlFromServer...'); this._processXmlFromServer(); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlFromServer finished.'); }, _processXmlFromServer: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_processXmlFromServer() { /// /// Processes the xml sent by the server. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(this._m_Response); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Calling ProcessXmlFromServer on AjaxManagerScript...'); this._m_PostRequestProcesses = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager(); this._m_Manager._processXmlFromServer(this._m_Response, this._m_PostRequestProcesses); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlFromServer on AjaxManagerScript finished.'); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Updating view state...'); var viewstate = this._m_Response.selectSingleNode('/AjaxManager/ViewState'); if (viewstate != null) { (this._m_Manager.get_form()[Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE]).value = viewstate.text; } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing updated controls...'); var nodes = this._m_Response.selectNodes('/AjaxManager/Updated/Control'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; var effect = (node.attributes.getNamedItem('Effect')).value; var scope = (node.attributes.getNamedItem('Scope')).value; var reason = (node.attributes.getNamedItem('Reason')).value; this._m_Manager._tearDownObjectsBelow(scope); var target = document.getElementById(id); var flipper = new Coveo.CNL.Web.Scripts.Ajax.ControlFlipper(target, node.text); if (!this._m_Manager.get_enableUpdateDebugging()) { this._m_PostRequestProcesses.add(Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create(target, flipper, effect)); } else { this._m_PostRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger(flipper, reason)); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Control ' + id + ' was updated.'); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing updated regions...'); nodes = this._m_Response.selectNodes('/AjaxManager/Updated/Region'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; var effect = (node.attributes.getNamedItem('Effect')).value; var scope = (node.attributes.getNamedItem('Scope')).value; var reason = (node.attributes.getNamedItem('Reason')).value; if (scope !== '') { this._m_Manager._tearDownObjectsBelow(scope); } var target = document.getElementById(id); var flipper = new Coveo.CNL.Web.Scripts.Ajax.RegionFlipper(target, node.text); if (!this._m_Manager.get_enableUpdateDebugging()) { this._m_PostRequestProcesses.add(Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.create(target, new Coveo.CNL.Web.Scripts.Ajax.RegionFlipper(target, node.text), effect)); } else { this._m_PostRequestProcesses.add(new Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger(flipper, reason)); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Region ' + id + ' was updated.'); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing modal boxes...'); nodes = this._m_Response.selectNodes('/AjaxManager/Close/Box'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var boxId = (node.attributes.getNamedItem('BoxId')).value; this._m_Manager._tearDownObjectsBelow(boxId); this._m_Manager.closeModalBox(boxId); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Modal box ' + boxId + ' was closed.'); } nodes = this._m_Response.selectNodes('/AjaxManager/ModalBoxes/Box'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var boxId = (node.attributes.getNamedItem('BoxId')).value; var width = Number.parse((node.attributes.getNamedItem('Width')).value); var height = Number.parse((node.attributes.getNamedItem('Height')).value); var horizontalMargin = Number.parse((node.attributes.getNamedItem('HorizontalMargin')).value); var verticalMargin = Number.parse((node.attributes.getNamedItem('VerticalMargin')).value); var EnableOutsideClick = Boolean.parse((node.attributes.getNamedItem('EnableOutsideClick')).value); var box = new Coveo.CNL.Web.Scripts.Ajax.ModalBox(this._m_Manager, boxId, node.text, width, height, horizontalMargin, verticalMargin, EnableOutsideClick); this._m_Manager.addModalBox(box); box.show(); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Modal box ' + boxId + ' was shown.'); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing postback return value...'); var retval = this._m_Response.selectSingleNode('/AjaxManager/Return'); var retvalHtml = this._m_Response.selectSingleNode('/AjaxManager/ReturnHtml'); var retvalXml = this._m_Response.selectSingleNode('/AjaxManager/ReturnXml'); if (retval != null) { var type = (retval.attributes.getNamedItem('Type')).value; this._m_ReturnValue = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(type, retval.text); } else if (retvalHtml != null) { var elem = document.createElement('div'); elem.innerHTML = retvalHtml.text; this._m_ReturnValue = elem; } else if (retvalXml != null) { this._m_ReturnValue = retvalXml; } var resetTimerCount = this._m_Response.selectSingleNode('/AjaxManager/ResetTimerCount'); if (resetTimerCount != null) { this._m_Manager.resetTimer(); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Starting Post-request processes...'); this._m_PostRequestProcesses.startAll(Delegate.create(this, this._postOperationsAreDoneCallback)); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Post-request processes started.'); if (this._m_Response.selectSingleNode('/AjaxManager/ScrollBackUp') != null) { Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp(); } }, _postOperationsAreDoneCallback: function Coveo_CNL_Web_Scripts_Ajax_PartialPostBack$_postOperationsAreDoneCallback(p_Sender, p_Args) { /// /// Callback for when all post request operations are done. /// /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Post-request operations are done.'); this._m_PostRequestProcesses = null; this._m_Manager._processXmlForAfterScriptsAreLoaded(this._m_Response); this._m_Manager._hookButtonControls(); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('ProcessXmlForAjaxObjects done.'); if (this._m_Callback != null) { this._m_Callback.invoke(this._m_ReturnValue); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Postback callback function called.'); } if (!this._m_IgnoreResults) { Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter(); } this._m_Manager.postBackIsFinished(); if (this._m_Profiler != null) { this._m_Profiler.stop(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax._feedbackInfo Coveo.CNL.Web.Scripts.Ajax._feedbackInfo = function Coveo_CNL_Web_Scripts_Ajax__feedbackInfo() { /// /// Holds information about a feedback /// /// /// /// /// /// /// /// /// /// /// } Coveo.CNL.Web.Scripts.Ajax._feedbackInfo.prototype = { m_Id: null, m_Name: null, m_Type: null, m_Target: null, m_Fullscreen: false } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript() { /// /// Client side code for the AjaxManager class. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// this._m_IdSubstitutions = {}; this._m_PartialOrFullMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings(); this._m_AlwaysSend = []; this._m_Feedbacks = []; this._m_FeedbackMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings(); this._m_FeedbackNameMappings = new Coveo.CNL.Web.Scripts.Ajax.IdMappings(); this._m_BlankOnHistory = []; this._m_LoadedScripts = {}; this._m_LoadedStyleSheets = {}; this._m_AjaxObjects = []; this._m_ModalBoxes = []; this._m_TimerId = -1; } Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_current() { /// /// The current instance of . /// /// return Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance; } Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated = function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_initial_History_Navigated(p_Sender, p_Args) { /// /// /// /// Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs = p_Args; } Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.prototype = { _m_Id: null, _m_Form: null, _m_Bootstrap: false, _m_FrameworkDoPostBack: null, _m_InitialViewState: null, _m_CurrentPostBack: null, _m_EnableProgress: false, _m_ProgressPageUri: null, _m_EnableUpdateDebugging: false, _m_EnableProfiling: false, _m_EnableHistory: false, _m_CurrentState: '', _m_TimerEnabled: true, _m_TimerInterval: 0, _m_TimerTickedCount: 0, _m_TimerHardStop: 0, _m_NbTimerBlockingControls: 0, _m_ControlToFocus: null, _m_MaxNumberOfFocusAttemps: 10, _m_CurrentNumberOfFocusAttemps: 0, _m_AsynchronousCalls: null, get_form: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_form() { /// /// The ASP.NET form inside the page. /// /// return this._m_Form; }, get_bootstrap: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_bootstrap() { /// /// Gets or sets whether the interface has been bootstrapped. /// /// return this._m_Bootstrap; }, set_bootstrap: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_bootstrap(value) { /// /// Gets or sets whether the interface has been bootstrapped. /// /// this._m_Bootstrap = value; return value; }, get_initialViewState: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_initialViewState() { /// /// The initial value of the viewstate. /// /// return this._m_InitialViewState; }, set_initialViewState: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_initialViewState(value) { /// /// The initial value of the viewstate. /// /// this._m_InitialViewState = value; return value; }, get_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableProgress() { /// /// Whether postback progress tracking is enabled. /// /// return this._m_EnableProgress; }, set_enableProgress: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableProgress(value) { /// /// Whether postback progress tracking is enabled. /// /// this._m_EnableProgress = value; return value; }, get_progressPageUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_progressPageUri() { /// /// Gets or sets the uri of the page used to fetch progress information. /// /// return this._m_ProgressPageUri; }, set_progressPageUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_progressPageUri(value) { /// /// Gets or sets the uri of the page used to fetch progress information. /// /// this._m_ProgressPageUri = value; return value; }, get_enableUpdateDebugging: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableUpdateDebugging() { /// /// Whether update debugging is enabled. /// /// return this._m_EnableUpdateDebugging; }, set_enableUpdateDebugging: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableUpdateDebugging(value) { /// /// Whether update debugging is enabled. /// /// this._m_EnableUpdateDebugging = value; return value; }, get_enableProfiling: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableProfiling() { /// /// Whether profiling is enabled. /// /// return this._m_EnableProfiling; }, set_enableProfiling: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableProfiling(value) { /// /// Whether profiling is enabled. /// /// this._m_EnableProfiling = value; return value; }, get_enableHistory: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_enableHistory() { /// /// Whether history is enabled. /// /// return this._m_EnableHistory; }, set_enableHistory: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$set_enableHistory(value) { /// /// Whether history is enabled. /// /// this._m_EnableHistory = value; return value; }, get_currentPostBack: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$get_currentPostBack() { /// /// The currently pending . /// /// return this._m_CurrentPostBack; }, initialize: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$initialize(p_Id, p_Form, p_DoPostBack, p_Xml, p_SkipInitialHistoryState) { /// /// Initializes a new instance of . /// /// /// The id of the AjaxManager control. /// /// /// The ASP.NET form element. /// /// /// The framework's __doPostBack function. /// /// /// The initialization xml. /// /// /// Whether to skip the initial history state. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Form); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_DoPostBack); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml); this._m_Id = p_Id; this._m_Form = p_Form; this._m_FrameworkDoPostBack = p_DoPostBack; this._m_TimerTickedCount = 0; var scripts = document.getElementsByTagName('script'); for (var i = 0; i < scripts.length; ++i) { var script = scripts[i]; var src = script.getAttribute('src'); if (!String.isNullOrEmpty(src)) { this.registerScript(src); } } var links = document.getElementsByTagName('link'); for (var i = 0; i < links.length; ++i) { var link = links[i]; var rel = link.getAttribute('rel'); var href = link.getAttribute('href'); if (String.compare(rel, 'stylesheet', true) === 0) { this._m_LoadedStyleSheets[href] = link; } } var app = ScriptFX.Application.current; if (this._m_EnableHistory) { app.get_history().remove_navigated(Delegate.create(null, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated)); app.get_history().add_navigated(Delegate.create(this, this._history_Navigated)); } if (p_SkipInitialHistoryState) { this._m_CurrentState = decodeURIComponent(window.location.hash.substr(1)); } var async = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager(); this._processXmlFromServer(p_Xml, async); async.startAll(Delegate.create(this, function(p_Sender, p_Args) { this._processXmlForAfterScriptsAreLoaded(p_Xml); this._hookButtonControls(); Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance = this; })); if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs != null) { this._history_Navigated(this, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs); } }, doPostBack: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$doPostBack(p_Target, p_Argument, p_Preemptive) { /// /// Replacement for the framework's __doPostBack function. /// /// /// The id of the target control. /// /// /// The postback arguments. /// /// /// Whether this is a preemptive postback. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Argument); this.cancelPendingOperations(); var substituted = this._getSubstitutedId(p_Target); if (this._isPartialPostbackTarget(substituted)) { var feedbacks = (!p_Preemptive) ? this._getFeedbacksForTarget(substituted) : []; this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, p_Target, p_Argument, feedbacks, p_Preemptive); this._m_CurrentPostBack.execute(); } else { this._m_FrameworkDoPostBack.invoke(p_Target, p_Argument); } return this._m_CurrentPostBack; }, doMethodCall: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$doMethodCall(p_Target, p_Method, p_Options, p_Callback, p_Args) { /// /// Performs a server-side method call. /// /// /// The id of the target control. /// /// /// The method to call. /// /// /// The string that holds the postback options. /// /// /// The callback for the method call. /// /// /// The arguments to pass to the method. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Method); Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Options); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Args); this.cancelPendingOperations(); var options = new Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript(p_Options); var args = 'M:' + encodeURIComponent(p_Target); args += '&' + encodeURIComponent(p_Method); for (var i = 0; i < p_Args.length - 1; ++i) { args += '&' + encodeURIComponent(Coveo.CNL.Web.Scripts.MarshalUtilities.marshalValue(p_Args[i])); } var substituted = this._getSubstitutedId(p_Target); if (options.get_forcePartialPostback() || this._isPartialPostbackTarget(substituted)) { var feedbacks = (options.get_triggerFeedbacks()) ? this._getFeedbacksForTarget(substituted) : []; this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, args, feedbacks, false); this._m_CurrentPostBack.set_callback(p_Callback); this._m_CurrentPostBack.set_sendControlData(options.get_sendControlData()); this._m_CurrentPostBack.set_ignoreResults(options.get_ignoreResults()); this._m_CurrentPostBack.execute(); } else { this._m_FrameworkDoPostBack.invoke(this._m_Id, args); } }, cancelPendingOperations: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$cancelPendingOperations() { /// /// Cancels any currently pending operation. /// if (this._m_CurrentPostBack != null) { this._m_CurrentPostBack.cancel(); this._m_CurrentPostBack = null; } }, shouldAlwaysBeSent: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$shouldAlwaysBeSent(p_Id) { /// /// Checks if a form field should always be sent to the server. /// /// /// The id of the form field. /// /// var always = false; var $enum1 = this._m_AlwaysSend.getEnumerator(); while ($enum1.moveNext()) { var id = $enum1.get_current(); if (String.compare(id, p_Id, true) === 0) { always = true; break; } } return always; }, isScriptLoaded: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$isScriptLoaded(p_Uri) { /// /// Checks if a script is already loaded. /// /// /// The uri of the script. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); var cleaned = this._cleanupScriptUri(p_Uri); return this._m_LoadedScripts[cleaned] != null || cleaned.indexOf('k=embedding') !== -1 || cleaned.indexOf('k=ccs') !== -1; }, registerScript: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$registerScript(p_Uri) { /// /// Registers a new loaded script. /// /// /// The uri of the script. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); var cleaned = this._cleanupScriptUri(p_Uri); this._m_LoadedScripts[cleaned] = 1; }, addModalBox: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$addModalBox(p_Box) { /// /// Adds a modal dialog box to the list. /// /// /// The to push. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Box); this._m_ModalBoxes.add(p_Box); }, closeModalBox: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$closeModalBox(p_BoxId) { /// /// Closes a modal box. /// /// /// The unique identifier of the box to close. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_BoxId); var found = null; var $enum1 = this._m_ModalBoxes.getEnumerator(); while ($enum1.moveNext()) { var box = $enum1.get_current(); if (box.get_id() === p_BoxId) { found = box; break; } } Coveo.CNL.Web.Scripts.CNLAssert.notNull(found); if (found.get_visible()) { found.close(); } this._m_ModalBoxes.remove(found); }, postBackIsFinished: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$postBackIsFinished() { /// /// Called when a PostBack is finished. /// this._m_CurrentPostBack = null; }, blockTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$blockTimer() { /// /// Block the timer. /// this._m_NbTimerBlockingControls += 1; }, unblockTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$unblockTimer() { /// /// Unblock and start the timer. /// this._m_NbTimerBlockingControls -= 1; Coveo.CNL.Web.Scripts.CNLAssert.check(this._m_NbTimerBlockingControls >= 0); if (this._m_NbTimerBlockingControls === 0) { this._startTimer(); } }, resetTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$resetTimer() { /// /// Reset the timer count. /// this._m_TimerTickedCount = 0; }, _processXmlFromServer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_processXmlFromServer(p_Xml, p_Async) { /// /// Processes xml sent by the server. /// /// /// The to process. /// /// /// The in which to register any required asynchronous process. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Async); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing redirect uri...'); var redirectUri = p_Xml.selectSingleNode('/AjaxManager/Redirect/Uri'); if (redirectUri != null) { var newWindow = p_Xml.selectSingleNode('/AjaxManager/Redirect/NewWindow'); if (newWindow != null && Boolean.parse(newWindow.text)) { window.open(redirectUri.text, '_blank'); } else { window.navigate(redirectUri.text); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing history state...'); var history = p_Xml.selectSingleNode('/AjaxManager/History'); if (history != null && this.get_enableHistory()) { this._m_CurrentState = history.text; ScriptFX.Application.current.get_history().addEntry(encodeURIComponent(this._m_CurrentState)); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' History state ' + this._m_CurrentState + ' was added.'); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing id substitutions...'); Object.clearKeys(this._m_IdSubstitutions); var nodes = p_Xml.selectNodes('/AjaxManager/Substitutions/Substitution'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; this._m_IdSubstitutions[(node.attributes.getNamedItem('Target')).value] = (node.attributes.getNamedItem('Substitute')).value; } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of partial postback controls...'); this._m_PartialOrFullMappings.clear(); nodes = p_Xml.selectNodes('/AjaxManager/Partial/Control'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; this._m_PartialOrFullMappings.add(this._getSubstitutedId(id), true); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of full postback controls...'); nodes = p_Xml.selectNodes('/AjaxManager/Full/Control'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; this._m_PartialOrFullMappings.add(this._getSubstitutedId(id), false); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list always sent form fields...'); this._m_AlwaysSend.clear(); nodes = p_Xml.selectNodes('/AjaxManager/AlwaysSend/AlwaysSend'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; this._m_AlwaysSend.add(id); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of panel feedbacks...'); this._m_Feedbacks.clear(); nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/PanelFeedback'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo(); info.m_Id = (node.attributes.getNamedItem('Id')).value; info.m_Type = (node.attributes.getNamedItem('Type')).value; info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value); var panel = this._getSubstitutedId((node.attributes.getNamedItem('Panel')).value); this._m_Feedbacks.add(info); this._m_FeedbackMappings.add(panel, info); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of named feedbacks...'); nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/NamedFeedback'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo(); info.m_Id = (node.attributes.getNamedItem('Id')).value; info.m_Name = (node.attributes.getNamedItem('Name')).value; info.m_Type = (node.attributes.getNamedItem('Type')).value; info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value); this._m_Feedbacks.add(info); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing list of targeted feedbacks...'); nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/TargetFeedback'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo(); info.m_Id = (node.attributes.getNamedItem('Id')).value; info.m_Target = (node.attributes.getNamedItem('TargetClientID')).value; info.m_Type = (node.attributes.getNamedItem('Type')).value; info.m_Fullscreen = Boolean.parse((node.attributes.getNamedItem('Fullscreen')).value); var target = this._getSubstitutedId((node.attributes.getNamedItem('TargetUniqueID')).value); this._m_Feedbacks.add(info); this._m_FeedbackMappings.add(target, info); } nodes = p_Xml.selectNodes('/AjaxManager/Feedbacks/NamedFeedbackMapping'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var info = new Coveo.CNL.Web.Scripts.Ajax._feedbackInfo(); info.m_Id = this._getSubstitutedId((node.attributes.getNamedItem('Id')).value); info.m_Name = (node.attributes.getNamedItem('Name')).value; this._m_FeedbackNameMappings.add(info.m_Id, info.m_Name); } this._m_BlankOnHistory.clear(); nodes = p_Xml.selectNodes('/AjaxManager/BlankOnHistory/BlankOnHistory'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(id); this._m_BlankOnHistory.add(id); } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing stylesheets...'); nodes = p_Xml.selectNodes('/AjaxManager/StyleSheets/StyleSheet'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var uri = node.text; if (this._m_LoadedStyleSheets[uri] == null) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = uri; if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { document.body.appendChild(link); } else { document.getElementsByTagName('head')[0].appendChild(link); } this._m_LoadedStyleSheets[uri] = link; Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Stylesheet ' + uri + ' was added to the DOM.'); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing stylesheets to unload...'); nodes = p_Xml.selectNodes('/AjaxManager/StyleSheets/Remove'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var uri = node.text; if (this._m_LoadedStyleSheets[uri] != null) { var link = this._m_LoadedStyleSheets[uri]; Coveo.CNL.Web.Scripts.DOMUtilities.removeLinkAndStylesheet(link); this._m_LoadedStyleSheets[uri] = null; Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Stylesheet ' + uri + ' was removed from the DOM.'); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing hidden fields...'); nodes = p_Xml.selectNodes('/AjaxManager/HiddenFields/HiddenField'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var name = (node.attributes.getNamedItem('Name')).value; var toDelete = Boolean.parse((node.attributes.getNamedItem('Delete')).value); var value = node.text; var input = document.getElementById(name); if (toDelete) { if (input != null) { input.parentNode.removeChild(input); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Field ' + name + ' was deleted.'); } } else { if (input == null) { input = document.createElement('input'); input.type = 'hidden'; input.id = name; input.name = name; var elements = this._m_Form.elements; elements[0].parentNode.appendChild(input); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Field ' + name + ' was created.'); } input.value = value; } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing images to update...'); nodes = p_Xml.selectNodes('/AjaxManager/ImagesToUpdate/ImageToUpdate'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; var value = node.text; var elem = document.getElementById(id); if (elem != null) { elem.src = value; Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' The url of control ' + id + ' was set to ' + value); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing control values...'); nodes = p_Xml.selectNodes('/AjaxManager/ControlValues/ControlValue'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var id = (node.attributes.getNamedItem('Id')).value; var value = node.text; var input = document.getElementById(id); if (input != null) { input.value = value; Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Value of control ' + id + ' was set to ' + value); } } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing timer stuff...'); var globalTimer = p_Xml.selectSingleNode('/AjaxManager/GlobalTimer'); if (globalTimer != null) { this._m_TimerInterval = Number.parse((globalTimer.attributes.getNamedItem('Delay')).value); this._m_TimerHardStop = Number.parse((globalTimer.attributes.getNamedItem('HardStop')).value); } else { this._m_TimerInterval = 0; this._m_TimerHardStop = 0; } if (this._m_TimerInterval > 0) { this._m_TimerEnabled = true; this._startTimer(); } else { this._m_TimerEnabled = false; window.clearTimeout(this._m_TimerId); this._m_TimerId = -1; } Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing external scripts...'); nodes = p_Xml.selectNodes('/AjaxManager/ExternalScripts/Script'); if (nodes.length > 0) { var loader = null; for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var uri = (node.attributes.getNamedItem('Uri')).value; if (!this.isScriptLoaded(uri)) { Coveo.CNL.Web.Scripts.CNLAssert.fail(); if (loader == null) { loader = new Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper(); } loader.add(uri); this.registerScript(uri); Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Script ' + uri + ' queued to be loaded.'); } } if (loader != null) { p_Async.add(loader); } } }, _processXmlForAfterScriptsAreLoaded: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_processXmlForAfterScriptsAreLoaded(p_Xml) { /// /// Processes the xml for the objects from the server. /// /// /// The to process. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Xml); Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing constants...'); var nodes = p_Xml.selectNodes('/AjaxManager/Consts/Const'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var cls = (node.attributes.getNamedItem('Class')).value; var name = (node.attributes.getNamedItem('Name')).value; var kind = (node.attributes.getNamedItem('Type')).value; var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, node.text); eval(cls)[name] = value; Coveo.CNL.Web.Scripts.Ajax.Profiler.log(' Constant ' + cls + '.' + name + ' was set to ' + value); } var count = 0; Coveo.CNL.Web.Scripts.Ajax.Profiler.log('Processing inline scripts...'); nodes = p_Xml.selectNodes('/AjaxManager/InlineScripts/Script'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; eval(node.text); ++count; } Coveo.CNL.Web.Scripts.Ajax.Profiler.log(count.toString() + ' inline scripts have been executed.'); nodes = p_Xml.selectNodes('/AjaxManager/AjaxObjects/AjaxObject'); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; var type = (node.attributes.getNamedItem('Type')).value; var ownerId = (node.attributes.getNamedItem('OwnerId')).value; var obj = eval('new ' + type + '()'); obj.set_ownerId(this._getSubstitutedId(ownerId)); var subs = node.selectNodes('ProtectedField'); for (var j = 0; j < subs.length; ++j) { var sub = subs[j]; var name = (sub.attributes.getNamedItem('Name')).value; var kind = (sub.attributes.getNamedItem('Type')).value; var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, sub.text); obj[name] = value; } subs = node.selectNodes('ProtectedDomElement'); for (var j = 0; j < subs.length; ++j) { var sub = subs[j]; var name = (sub.attributes.getNamedItem('Name')).value; var id = (sub.attributes.getNamedItem('Id')).value; var elem = document.getElementById(id); Coveo.CNL.Web.Scripts.CNLAssert.notNull(elem); obj[name] = elem; } subs = node.selectNodes('ProtectedMethods'); for (var j = 0; j < subs.length; ++j) { var sub = subs[j]; var name = (sub.attributes.getNamedItem('Name')).value; eval('obj.' + name + ' = ' + sub.text + ';'); } subs = node.selectNodes('PublicProperty'); for (var j = 0; j < subs.length; ++j) { var sub = subs[j]; var name = (sub.attributes.getNamedItem('Name')).value; var kind = (sub.attributes.getNamedItem('Type')).value; var value = Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue(kind, sub.text); obj['set_' + name](value); } this._m_AjaxObjects.add(obj); obj.initialize(); subs = node.selectNodes('Method'); for (var j = 0; j < subs.length; j++) { var sub = subs[j]; var name = (sub.attributes.getNamedItem('Name')).value; eval('obj.' + name + '(' + sub.text + ');'); } } this._m_AsynchronousCalls = p_Xml.selectNodes('/AjaxManager/AsynchronousCalls/AsynchronousCall'); if (this._m_AsynchronousCalls.length > 0) { if (!Coveo.CNL.Web.Scripts.Browser.get_isIE() || eval('document.readyState') === 'complete') { this._runAsynchronousCalls(); } else { var runCalls = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._runAsynchronousCalls), 0); } } var focus = p_Xml.selectSingleNode('/AjaxManager/SetFocus'); if (focus != null) { this._m_ControlToFocus = focus.text; this._m_CurrentNumberOfFocusAttemps = 0; var timer = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._setFocus), 0); } else { this._m_ControlToFocus = ''; } var pageTitle = p_Xml.selectSingleNode('/AjaxManager/PageTitle'); if (pageTitle != null) { document.title = pageTitle.text; } }, _hookButtonControls: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_hookButtonControls() { /// /// Hooks the OnClick event of all button controls within the form. /// var elems = this._m_Form.getElementsByTagName('input'); for (var i = 0; i < elems.length; ++i) { var elem = elems[i]; if ((elem.type === 'submit' || elem.type === 'button' || elem.type === 'image') && elem.onclick == null) { var name = elem.name; var d = this._createOnClickDelegateForButton(name); elem.onclick = d; } } }, _tearDownObjectsBelow: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_tearDownObjectsBelow(p_Scope) { /// /// Removes all objects registered under a given scope. /// /// /// The scope at which to remove objects. /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Scope); var scope = this._getSubstitutedId(p_Scope); var toRemove = []; var $enum1 = this._m_AjaxObjects.getEnumerator(); while ($enum1.moveNext()) { var obj = $enum1.get_current(); if (obj.get_ownerId().startsWith(scope)) { toRemove.add(obj); } } var $enum2 = toRemove.getEnumerator(); while ($enum2.moveNext()) { var obj = $enum2.get_current(); obj.tearDown(); this._m_AjaxObjects.remove(obj); } }, _setFocus: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_setFocus() { /// /// Sets the focus on the element to focus. /// this._m_CurrentNumberOfFocusAttemps++; if (!String.isNullOrEmpty(this._m_ControlToFocus)) { var elem = document.getElementById(this._m_ControlToFocus); try { elem.focus(); if (document.activeElement !== elem && this._m_CurrentNumberOfFocusAttemps < this._m_MaxNumberOfFocusAttemps) { var timer = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._setFocus), 0); } } catch ($e1) { } } }, _isPartialPostbackTarget: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_isPartialPostbackTarget(p_Target) { /// /// Checks if postbacks to a target control should be partial. /// /// /// The target control. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); var partial; var mapping = this._m_PartialOrFullMappings.get(p_Target); if (mapping != null) { partial = mapping; } else { partial = false; } return partial; }, _getFeedbacksForTarget: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_getFeedbacksForTarget(p_Target) { /// /// Retrieves the list of objects for a given postback target. /// /// /// The target of the postback.. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Target); var toCreate = []; var feedback = this._m_FeedbackMappings.get(p_Target); if (feedback != null) { toCreate.add(feedback); } var name = this._m_FeedbackNameMappings.get(p_Target); if (name != null) { var $enum1 = this._m_Feedbacks.getEnumerator(); while ($enum1.moveNext()) { var fb = $enum1.get_current(); if (String.compare(fb.m_Name, name, true) === 0) { toCreate.add(fb); } } } var feedbacks = []; var $enum2 = toCreate.getEnumerator(); while ($enum2.moveNext()) { var fb = $enum2.get_current(); feedbacks.add(Coveo.CNL.Web.Scripts.Ajax.Feedback.create(fb.m_Id, fb.m_Type, fb.m_Target, fb.m_Fullscreen)); } return feedbacks; }, _getSubstitutedId: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_getSubstitutedId(p_Id) { /// /// Apply any registered substitution to a control id. /// /// /// The id to substitute. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Id); var substituted = p_Id; var $dict1 = this._m_IdSubstitutions; for (var $key2 in $dict1) { var entry = { key: $key2, value: $dict1[$key2] }; if (substituted.startsWith(entry.key)) { substituted = entry.value + substituted.substring(entry.key.length, substituted.length); } } return substituted; }, _cleanupScriptUri: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_cleanupScriptUri(p_Uri) { /// /// Cleans up a script uri, removing the changing part that may differ on /// multiple servers member of the same NLB cluster. /// /// /// The uri of the script to clean up. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Uri); var cleaned = p_Uri; var beg = cleaned.indexOf('&z='); if (beg !== -1) { var end = cleaned.indexOf('&', beg + 1); if (end !== -1) { cleaned = cleaned.remove(beg, end - beg); } else { cleaned = cleaned.remove(beg, cleaned.length - beg); } } return cleaned; }, _createOnClickDelegateForButton: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_createOnClickDelegateForButton(p_Name) { /// /// Creates a delegate for hooking up the onclick event of a button. /// /// /// The name of the button to hook. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notEmpty(p_Name); return Delegate.create(this, function() { this.doPostBack(p_Name, '', false); return false; }); }, _history_Navigated: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_history_Navigated(p_Sender, p_Args) { /// /// /// /// var decoded = decodeURIComponent(p_Args.get_entryName()); if (decoded !== this._m_CurrentState) { var blank = []; var $enum1 = this._m_BlankOnHistory.getEnumerator(); while ($enum1.moveNext()) { var id = $enum1.get_current(); var elem = document.getElementById(id); Coveo.CNL.Web.Scripts.CNLAssert.notNull(elem); elem.style.visibility = 'hidden'; blank.add(elem); } this._m_CurrentState = decoded; this.cancelPendingOperations(); this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, 'R:' + this._m_CurrentState, [], false); this._m_CurrentPostBack.set_sendControlData(false); this._m_CurrentPostBack.set_callback(Delegate.create(this, function(p_Return) { var $enum1 = blank.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); elem.style.visibility = 'visible'; } })); this._m_CurrentPostBack.execute(); } }, _timerTick: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_timerTick() { this._m_TimerId = -1; this._m_TimerTickedCount += 1; if (this._m_NbTimerBlockingControls === 0) { if (this._m_CurrentPostBack == null) { this._m_CurrentPostBack = new Coveo.CNL.Web.Scripts.Ajax.PartialPostBack(this, this._m_Id, 'T:', [], false); this._m_CurrentPostBack.set_sendControlData(false); this._m_CurrentPostBack.set_enableProgress(false); this._m_CurrentPostBack.execute(); } else { this._startTimer(); } } }, _startTimer: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_startTimer() { /// /// Start the timer if it is enabled, no controls are blocking it, it is /// not already started and the interval is valid. /// if (this._m_TimerEnabled) { if (this._m_TimerHardStop === 0 || this._m_TimerTickedCount < this._m_TimerHardStop) { if (this._m_NbTimerBlockingControls === 0) { if (this._m_TimerId === -1) { if (this._m_TimerInterval > 0) { this._m_TimerId = window.setTimeout(Delegate.create(this, this._timerTick), this._m_TimerInterval); } } } } } }, _runAsynchronousCalls: function Coveo_CNL_Web_Scripts_Ajax_AjaxManagerScript$_runAsynchronousCalls() { /// /// Executes the asynchronous calls if any. /// if (this._m_AsynchronousCalls != null) { for (var i = 0; i < this._m_AsynchronousCalls.length; ++i) { var node = this._m_AsynchronousCalls[i]; Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter(); eval(node.text); } this._m_AsynchronousCalls = null; } } } Type.createNamespace('Coveo.CNL.Web.Scripts.BetterControls'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript = function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript() { /// /// Client side code for the BetterButton control. /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.constructBase(this); } Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.prototype = { m_Button: null, m_DisableOnClick: false, m_DisableAlso: null, _m_ButtonClickDomEventHandler$1: null, initialize: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$initialize() { this._m_ButtonClickDomEventHandler$1 = Delegate.create(this, this._button_OnClick$1); this.m_Button.attachEvent('onclick', this._m_ButtonClickDomEventHandler$1); }, tearDown: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$tearDown() { if (this._m_ButtonClickDomEventHandler$1 != null) { this.m_Button.detachEvent('onclick', this._m_ButtonClickDomEventHandler$1); this._m_ButtonClickDomEventHandler$1 = null; } }, _button_OnClick$1: function Coveo_CNL_Web_Scripts_BetterControls_BetterButtonScript$_button_OnClick$1() { if (this.m_DisableOnClick) { this.m_Button.disabled = true; if (!String.isNullOrEmpty(this.m_DisableAlso)) { var deserializer = new Coveo.CNL.Web.Scripts.StringDeserializer(this.m_DisableAlso); var names = deserializer.getStringArray(); var $enum1 = names.getEnumerator(); while ($enum1.moveNext()) { var name = $enum1.get_current(); var element = document.getElementById(name); if (element != null) { element.disabled = true; } } } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript = function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript() { /// /// Client side code for the BetterLinkButton control. /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.constructBase(this); } Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.prototype = { m_Button: null, m_DisableOnClick: false, _m_ButtonClickDomEventHandler$1: null, initialize: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$initialize() { this._m_ButtonClickDomEventHandler$1 = Delegate.create(this, this._button_OnClick$1); this.m_Button.attachEvent('onclick', this._m_ButtonClickDomEventHandler$1); }, tearDown: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$tearDown() { if (this._m_ButtonClickDomEventHandler$1 != null) { this.m_Button.detachEvent('onclick', this._m_ButtonClickDomEventHandler$1); this._m_ButtonClickDomEventHandler$1 = null; } }, _button_OnClick$1: function Coveo_CNL_Web_Scripts_BetterControls_BetterLinkButtonScript$_button_OnClick$1() { if (this.m_DisableOnClick) { this.m_Button.disabled = true; } } } Type.createNamespace('Coveo.CNL.Web.Scripts.Misc'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript = function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript() { /// /// Client side code for a textbox control who postbacks everytime the user stops typing. /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.constructBase(this); } Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.prototype = { _m_KeyDownEventHandler$1: null, _m_KeyUpEventHandler$1: null, m_TextBox: null, m_PostbackTimeout: null, initialize: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$initialize() { Coveo.CNL.Web.Scripts.CNLAssert.notNull(this.m_TextBox); this._m_KeyDownEventHandler$1 = Delegate.create(this, this._textBox_KeyDown$1); this._m_KeyUpEventHandler$1 = Delegate.create(this, this._textBox_KeyUp$1); this.m_TextBox.attachEvent('onkeydown', this._m_KeyDownEventHandler$1); this.m_TextBox.attachEvent('onkeyup', this._m_KeyUpEventHandler$1); }, tearDown: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$tearDown() { if (this._m_KeyDownEventHandler$1 != null) { this.m_TextBox.detachEvent('onkeydown', this._m_KeyDownEventHandler$1); this._m_KeyDownEventHandler$1 = null; } if (this._m_KeyUpEventHandler$1 != null) { this.m_TextBox.detachEvent('onkeyup', this._m_KeyUpEventHandler$1); this._m_KeyUpEventHandler$1 = null; } this.m_TextBox = null; }, fireTextChanged: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$fireTextChanged(p_Text, p_Callback) { /// /// /// /// }, fireEscapePressed: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$fireEscapePressed() { }, _textBox_KeyDown$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textBox_KeyDown$1() { if (window.event.keyCode === 27) { window.event.cancelBubble = true; window.event.returnValue = false; this._cancelPendingTimeout$1(); this.fireEscapePressed(); } }, _textBox_KeyUp$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textBox_KeyUp$1() { var keyCode = window.event.keyCode; if (keyCode === 13 || keyCode === 9) { this._cancelPendingTimeout$1(); this._startTextChanged$1(); } else if (keyCode === 16 || keyCode === 17 || keyCode === 19 || keyCode === 20 || keyCode === 27 || keyCode === 33 || keyCode === 34 || keyCode === 35 || keyCode === 36 || keyCode === 144 || keyCode === 145) { } else if (keyCode >= 37 && keyCode <= 40) { } else if (keyCode >= 112 && keyCode <= 123) { } else { this._cancelPendingTimeout$1(); this._scheduleTextChanged$1(); } }, _scheduleTextChanged$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_scheduleTextChanged$1() { /// /// Schedules a TextChanged event. /// Coveo.CNL.Web.Scripts.CNLAssert.isNull(this.m_PostbackTimeout); this.m_PostbackTimeout = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._startTextChanged$1), Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript._postbacK_DELAY$1); }, _cancelPendingTimeout$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_cancelPendingTimeout$1() { /// /// Cancels any pending TextChanged event. /// if (this.m_PostbackTimeout != null) { this.m_PostbackTimeout.cancel(); this.m_PostbackTimeout = null; } }, _startTextChanged$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_startTextChanged$1() { /// /// Launches a TextChanged event on the server. /// this.m_PostbackTimeout = null; if (this.m_TextBox != null) { this.fireTextChanged(this.m_TextBox.value, Delegate.create(this, this._textChangedCallback$1)); } }, _textChangedCallback$1: function Coveo_CNL_Web_Scripts_Misc_TextChangedEventScript$_textChangedCallback$1(p_Return) { /// /// Callback for when the server has handled the TextChanged event. /// /// /// The return of the call to the server. /// } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Misc.ToolTipScript Coveo.CNL.Web.Scripts.Misc.ToolTipScript = function Coveo_CNL_Web_Scripts_Misc_ToolTipScript() { /// /// Client side code for the Tooltip control. /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.Misc.ToolTipScript.constructBase(this); } Coveo.CNL.Web.Scripts.Misc.ToolTipScript.prototype = { m_HotSpot: null, m_PopupParent: null, m_Position: 0, m_MaxWidth: 0, m_ShowOnHover: false, m_ShowDelay: 0, m_HideDelay: 0, m_ShowOnClick: false, m_HideOnClick: false, m_FadeIn: false, _m_OnDwellEvent$1: null, _m_OnLeaveManyEvent$1: null, _m_Popup$1: null, _m_PostShowProcesses$1: null, _m_HotSpotClickDomEventHandler$1: null, _m_ToolTipClickDomEventHandler$1: null, initialize: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$initialize() { this._registerProperEvents$1(); }, tearDown: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$tearDown() { this._getRidOfEverything$1(); }, fetchToolTipContent: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$fetchToolTipContent(p_Callback) { /// /// Placeholder for the server call that fetches the tooltip. /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.fail(); }, _showToolTipIfNotVisible$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_showToolTipIfNotVisible$1() { /// /// Begins showing the tooltip. /// if (this._m_Popup$1 == null) { if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) { Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().blockTimer(); } this.fetchToolTipContent(Delegate.create(this, this._fetchToolTipCallback$1)); } }, _hideToolTipIfVisible$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hideToolTipIfVisible$1() { /// /// Hides the tooltip if it is visible. /// if (this._m_Popup$1 != null) { this._getRidOfEverything$1(); this._m_Popup$1.parentNode.removeChild(this._m_Popup$1); this._m_Popup$1 = null; this._registerProperEvents$1(); if (Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current() != null) { Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.get_current().unblockTimer(); } } }, _fetchToolTipCallback$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_fetchToolTipCallback$1(p_Return) { /// /// Handles the return value of the call to fetch the tooltip content. /// /// /// this._getRidOfEverything$1(); var content = p_Return; this._m_Popup$1 = document.createElement('div'); this._m_Popup$1.appendChild(content); this._m_Popup$1.style.position = 'absolute'; this._m_Popup$1.style.zIndex = Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex(); if (this.m_FadeIn) { Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity(this._m_Popup$1, 0); } this.m_PopupParent.appendChild(this._m_Popup$1); if (this.m_MaxWidth !== 0 && Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(this._m_Popup$1).width > this.m_MaxWidth) { this._m_Popup$1.style.width = this.m_MaxWidth + 'px'; } Coveo.CNL.Web.Scripts.DOMUtilities.positionElement(this._m_Popup$1, this.m_HotSpot, this.m_Position); this._registerProperEvents$1(); if (this.m_FadeIn) { this._m_PostShowProcesses$1 = new Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager(); this._m_PostShowProcesses$1.add(new Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect(this._m_Popup$1)); this._m_PostShowProcesses$1.startAll(null); } }, _registerProperEvents$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_registerProperEvents$1() { /// /// Registers the events depending on the state. /// if (this._m_Popup$1 == null) { if (this.m_ShowOnHover) { this._m_OnDwellEvent$1 = new Coveo.CNL.Web.Scripts.OnDwellEvent(this.m_HotSpot, this.m_ShowDelay, Delegate.create(this, this._hotSpot_OnDwell$1)); } if (this.m_ShowOnClick) { this._m_HotSpotClickDomEventHandler$1 = Delegate.create(this, this._hotSpot_OnClick$1); this.m_HotSpot.attachEvent('onclick', this._m_HotSpotClickDomEventHandler$1); } } else { if (this.m_ShowOnHover) { this._m_OnLeaveManyEvent$1 = new Coveo.CNL.Web.Scripts.OnLeaveManyEvent([ this.m_HotSpot, this.m_PopupParent, this._m_Popup$1 ], this.m_HideDelay, Delegate.create(this, this._toolTip_OnLeave$1)); } if (this.m_HideOnClick) { this._m_ToolTipClickDomEventHandler$1 = Delegate.create(this, this._toolTip_OnClick$1); this._m_Popup$1.attachEvent('onclick', this._m_ToolTipClickDomEventHandler$1); } } }, _getRidOfEverything$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_getRidOfEverything$1() { /// /// Unregisters all events, stops all async processes, etc. /// if (this._m_PostShowProcesses$1 != null) { this._m_PostShowProcesses$1.terminateAll(); this._m_PostShowProcesses$1 = null; } if (this._m_OnDwellEvent$1 != null) { this._m_OnDwellEvent$1.dispose(); this._m_OnDwellEvent$1 = null; } if (this._m_OnLeaveManyEvent$1 != null) { this._m_OnLeaveManyEvent$1.dispose(); this._m_OnLeaveManyEvent$1 = null; } if (this.m_ShowOnClick) { if (this._m_HotSpotClickDomEventHandler$1 != null) { this.m_HotSpot.detachEvent('onclick', this._m_HotSpotClickDomEventHandler$1); this._m_HotSpotClickDomEventHandler$1 = null; } } if (this._m_Popup$1 != null && this.m_HideOnClick) { if (this._m_ToolTipClickDomEventHandler$1 != null) { this._m_Popup$1.detachEvent('onclick', this._m_ToolTipClickDomEventHandler$1); this._m_ToolTipClickDomEventHandler$1 = null; } } }, _hotSpot_OnDwell$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hotSpot_OnDwell$1() { this._showToolTipIfNotVisible$1(); }, _hotSpot_OnClick$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_hotSpot_OnClick$1() { this._showToolTipIfNotVisible$1(); }, _toolTip_OnLeave$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_toolTip_OnLeave$1() { this._hideToolTipIfVisible$1(); }, _toolTip_OnClick$1: function Coveo_CNL_Web_Scripts_Misc_ToolTipScript$_toolTip_OnClick$1() { this._hideToolTipIfVisible$1(); } } Type.createNamespace('Coveo.CNL.Web.Scripts'); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.PositionEnum Coveo.CNL.Web.Scripts.PositionEnum = function() { /// /// This enumeration lists the positions (relative to another object) where /// a box can be dynamically placed. /// /// /// Left of the reference object, and going up. /// /// /// Left of the reference object, and going down. /// /// /// Right of the reference object, and going up. /// /// /// Right of the reference object, and goind down. /// /// /// Above the reference object, and left aligned. /// /// /// Above the reference object, and right aligned /// /// /// Below the reference object, and left aligned /// /// /// Below the reference object, and right aligned /// }; Coveo.CNL.Web.Scripts.PositionEnum.prototype = { leftAbove: 0, leftBelow: 1, rightAbove: 2, rightBelow: 3, aboveLeft: 4, aboveRight: 5, belowLeft: 6, belowRight: 7 } Coveo.CNL.Web.Scripts.PositionEnum.createEnum('Coveo.CNL.Web.Scripts.PositionEnum', false); //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.OnClickElsewhereEvent Coveo.CNL.Web.Scripts.OnClickElsewhereEvent = function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent(p_Elements, p_Handler, p_EscapeToo) { /// /// Implements an event that fires when the user clicks somewhere else than on a given set of elements. /// /// /// The elements outside of which a click must occur. /// /// /// The that handles the event. /// /// /// Whether to trigger the event when the user presses Escape. /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Elements); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler); this._m_Elements = p_Elements; this._m_Handler = p_Handler; this._m_ClickDomEventHandler = Delegate.create(this, this._body_Click); document.body.attachEvent('onclick', this._m_ClickDomEventHandler); if (p_EscapeToo) { this._m_KeyDownEventHandler = Delegate.create(this, this._body_KeyDown); document.body.attachEvent('onkeydown', this._m_KeyDownEventHandler); } } Coveo.CNL.Web.Scripts.OnClickElsewhereEvent.prototype = { _m_Elements: null, _m_Handler: null, _m_ClickDomEventHandler: null, _m_KeyDownEventHandler: null, dispose: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$dispose() { /// /// Detaches the event handler. /// if (this._m_ClickDomEventHandler != null) { document.body.detachEvent('onclick', this._m_ClickDomEventHandler); this._m_ClickDomEventHandler = null; } if (this._m_KeyDownEventHandler != null) { document.body.detachEvent('onkeydown', this._m_KeyDownEventHandler); this._m_KeyDownEventHandler = null; } }, _body_Click: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$_body_Click() { var contains = false; var $enum1 = this._m_Elements.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); if (elem.contains(window.event.srcElement)) { contains = true; break; } } if (!contains) { this._m_Handler.invoke(); } }, _body_KeyDown: function Coveo_CNL_Web_Scripts_OnClickElsewhereEvent$_body_KeyDown() { if (window.event.keyCode === 27) { this._m_Handler.invoke(); } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.StringDeserializer Coveo.CNL.Web.Scripts.StringDeserializer = function Coveo_CNL_Web_Scripts_StringDeserializer(p_String) { /// /// Allows data to be deserialized from a string built by StringSerializer. /// /// /// The string that contains the serialized data. /// /// /// /// /// /// /// /// /// /// /// /// /// The separator used to delimitate fields. /// /// /// The character used for character escapes. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String); this._m_String = p_String; this._m_Separator = Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR; this._m_Special = [ Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER, Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR ]; } Coveo.CNL.Web.Scripts.StringDeserializer.prototype = { _m_String: null, _m_Separator: null, _m_Special: null, _m_Current: 0, _m_Builder: null, get_EOF: function Coveo_CNL_Web_Scripts_StringDeserializer$get_EOF() { /// /// This property will return true whenever end of file has been reached. /// /// return this._m_Current === this._m_String.length; }, getInt: function Coveo_CNL_Web_Scripts_StringDeserializer$getInt() { /// /// Deserializes an integer. /// /// return Number.parse(this._getNextValue()); }, getDouble: function Coveo_CNL_Web_Scripts_StringDeserializer$getDouble() { /// /// Deserializes a double. /// /// return Number.parse(this._getNextValue()); }, getBool: function Coveo_CNL_Web_Scripts_StringDeserializer$getBool() { /// /// Deserializes a boolean. /// /// return (this._getNextValue() === '0') ? false : true; }, getString: function Coveo_CNL_Web_Scripts_StringDeserializer$getString() { /// /// Deserializes a string. /// /// var value = this._getNextValue(); var pos = value.indexOf(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER); if (pos !== -1) { if (this._m_Builder == null) { this._m_Builder = new StringBuilder(); } else { this._m_Builder.clear(); } var last = 0; do { this._m_Builder.append(value.substring(last, pos)); if (value.charAt(pos + 1) === Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER) { this._m_Builder.append(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER); } else { this._m_Builder.append(this._m_Separator); } last = pos + 2; pos = value.indexOf(Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER, last); } while (pos !== -1); this._m_Builder.append(value.substring(last, value.length)); value = this._m_Builder.toString(); } return value; }, getStringArray: function Coveo_CNL_Web_Scripts_StringDeserializer$getStringArray() { /// /// Deserializes an array of strings. /// /// var length = this.getInt(); var array = new Array(length); for (var i = 0; i < length; ++i) { array[i] = this.getString(); } return array; }, _getNextValue: function Coveo_CNL_Web_Scripts_StringDeserializer$_getNextValue() { /// /// Retrieves the next value in the serialized string. /// /// Coveo.CNL.Web.Scripts.CNLAssert.check(!this.get_EOF()); var pos = this._m_String.indexOfAny(this._m_Special, this._m_Current); while (pos !== -1) { var cur = this._m_String.charAt(pos); if (cur === Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER) { Coveo.CNL.Web.Scripts.CNLAssert.check(pos < this._m_String.length - 1); pos += 2; } else if (cur === this._m_Separator) { break; } pos = this._m_String.indexOfAny(this._m_Special, pos); } var value; if (pos !== -1) { value = this._m_String.substring(this._m_Current, pos); this._m_Current = pos + 1; } else { value = this._m_String.substring(this._m_Current, this._m_String.length); this._m_Current = this._m_String.length; } return value; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.TransferMargin Coveo.CNL.Web.Scripts.TransferMargin = function Coveo_CNL_Web_Scripts_TransferMargin(p_From, p_To) { /// /// Allows transfering the margins of a to another element. /// /// /// The whose margins to transfer. /// /// /// The to which to transfer margins. /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_From); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_To); this._m_From = p_From; p_To.style.marginLeft = p_From.currentStyle.marginLeft; p_To.style.marginTop = p_From.currentStyle.marginTop; p_To.style.marginRight = p_From.currentStyle.marginRight; p_To.style.marginBottom = p_From.currentStyle.marginBottom; this._m_Left = p_From.style.marginLeft; p_From.style.marginLeft = '0px'; this._m_Top = p_From.style.marginTop; p_From.style.marginTop = '0px'; this._m_Right = p_From.style.marginRight; p_From.style.marginRight = '0px'; this._m_Bottom = p_From.style.marginBottom; p_From.style.marginBottom = '0px'; } Coveo.CNL.Web.Scripts.TransferMargin.prototype = { _m_From: null, _m_Left: null, _m_Top: null, _m_Right: null, _m_Bottom: null, restore: function Coveo_CNL_Web_Scripts_TransferMargin$restore() { /// /// Restores the margins to their initial state. /// this._m_From.style.marginLeft = this._m_Left; this._m_From.style.marginTop = this._m_Top; this._m_From.style.marginRight = this._m_Right; this._m_From.style.marginBottom = this._m_Bottom; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Timeout Coveo.CNL.Web.Scripts.Timeout = function Coveo_CNL_Web_Scripts_Timeout(p_Callback, p_Delay) { /// /// Encapsulates usage of Window.SetTimeout/> and Window.ClearTimeout. /// /// /// The to call when the timeout fires.. /// /// /// The delay after which to call the callback (in milliseconds). /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Callback != null); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Delay >= 0); this._m_Callback = p_Callback; this._m_Timer = window.setTimeout(Delegate.create(this, this._timerCallback), p_Delay); } Coveo.CNL.Web.Scripts.Timeout.prototype = { _m_Timer: 0, _m_Callback: null, cancel: function Coveo_CNL_Web_Scripts_Timeout$cancel() { /// /// Cancels the timeout, preventing it from firing. /// if (this._m_Timer !== 0) { window.clearTimeout(this._m_Timer); this._m_Timer = 0; } }, _timerCallback: function Coveo_CNL_Web_Scripts_Timeout$_timerCallback() { /// /// Callback for when the timeout fires. /// if (this._m_Timer !== 0) { this._m_Callback.invoke(); this._m_Timer = 0; } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.OnLeaveManyEvent Coveo.CNL.Web.Scripts.OnLeaveManyEvent = function Coveo_CNL_Web_Scripts_OnLeaveManyEvent(p_Elements, p_Delay, p_Handler) { /// /// Implements an event that fires when the mouse leaves a list of objects for long enough. /// /// /// The elements on which to hook the event. /// /// /// The delay during which the mouse must have been outside the elements for the event to fire. /// /// /// The that handles the event. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Elements); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Delay > 0); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler); this.attach(p_Elements, p_Delay, p_Handler); } Coveo.CNL.Web.Scripts.OnLeaveManyEvent.prototype = { _m_Elements: null, _m_Delay: 0, _m_Handler: null, _m_OnMouseOverHandler: null, _m_OnMouseOutHandler: null, _m_Timeout: null, dispose: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$dispose() { /// /// Detaches the event handler. /// if (this._m_Timeout != null) { this._m_Timeout.cancel(); this._m_Timeout = null; } var $enum1 = this._m_Elements.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); elem.detachEvent('onmouseover', this._m_OnMouseOverHandler); elem.detachEvent('onmouseout', this._m_OnMouseOutHandler); } }, attach: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$attach(p_Elements, p_Delay, p_Handler) { /// /// Ataches the event handler. /// /// /// The elements on which to hook the event. /// /// /// The delay during which the mouse must have been outside the elements for the event to fire. /// /// /// The that handles the event. /// this._m_Elements = p_Elements; this._m_Delay = p_Delay; this._m_Handler = p_Handler; this._m_OnMouseOverHandler = Delegate.create(this, this._element_OnMouseOver); this._m_OnMouseOutHandler = Delegate.create(this, this._element_OnMouseOut); var $enum1 = this._m_Elements.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); elem.attachEvent('onmouseover', this._m_OnMouseOverHandler); elem.attachEvent('onmouseout', this._m_OnMouseOutHandler); } }, _fireRealHandler: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_fireRealHandler() { /// /// Called when the mouse has left the elements for long enough. /// this._m_Timeout = null; this._m_Handler.invoke(); }, _element_OnMouseOver: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_element_OnMouseOver() { var outside = true; var $enum1 = this._m_Elements.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); if (elem.contains(window.event.fromElement)) { outside = false; break; } } if (outside) { if (this._m_Timeout != null) { this._m_Timeout.cancel(); this._m_Timeout = null; } } }, _element_OnMouseOut: function Coveo_CNL_Web_Scripts_OnLeaveManyEvent$_element_OnMouseOut() { var outside = true; var $enum1 = this._m_Elements.getEnumerator(); while ($enum1.moveNext()) { var elem = $enum1.get_current(); if (elem.contains(window.event.toElement)) { outside = false; break; } } if (outside) { if (this._m_Timeout == null) { this._m_Timeout = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._fireRealHandler), this._m_Delay); } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.OnDwellEvent Coveo.CNL.Web.Scripts.OnDwellEvent = function Coveo_CNL_Web_Scripts_OnDwellEvent(p_Element, p_Delay, p_Handler) { /// /// Implements an event that fires when the mouse dwells over a . /// /// /// The element on which to hook the event. /// /// /// The delay during which the mouse must hover the element for the event to fire. /// /// /// The that handles the event. /// /// /// /// /// /// /// /// /// /// /// /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Delay > 0); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Handler); this._m_Element = p_Element; this._m_Delay = p_Delay; this._m_Handler = p_Handler; this._m_MouseOverDomEventHandler = Delegate.create(this, this._element_OnMouseOver); this._m_Element.attachEvent('onmouseover', this._m_MouseOverDomEventHandler); this._m_MouseOutDomEventHandler = Delegate.create(this, this._element_OnMouseOut); this._m_Element.attachEvent('onmouseout', this._m_MouseOutDomEventHandler); } Coveo.CNL.Web.Scripts.OnDwellEvent.prototype = { _m_Element: null, _m_Delay: 0, _m_Handler: null, _m_Timeout: null, _m_MouseOverDomEventHandler: null, _m_MouseOutDomEventHandler: null, dispose: function Coveo_CNL_Web_Scripts_OnDwellEvent$dispose() { /// /// Detaches the event handler. /// if (this._m_Timeout != null) { this._m_Timeout.cancel(); this._m_Timeout = null; } if (this._m_MouseOverDomEventHandler != null) { this._m_Element.detachEvent('onmouseover', this._m_MouseOverDomEventHandler); this._m_MouseOverDomEventHandler = null; } if (this._m_MouseOutDomEventHandler != null) { this._m_Element.detachEvent('onmouseout', this._m_MouseOutDomEventHandler); this._m_MouseOutDomEventHandler = null; } }, _fireRealHandler: function Coveo_CNL_Web_Scripts_OnDwellEvent$_fireRealHandler() { /// /// Called when the mouse has dwelt long enough over the element. /// this._m_Timeout = null; this._m_Handler.invoke(); }, _element_OnMouseOver: function Coveo_CNL_Web_Scripts_OnDwellEvent$_element_OnMouseOver() { if (window.event.fromElement != null && !this._m_Element.contains(window.event.fromElement)) { Coveo.CNL.Web.Scripts.CNLAssert.isNull(this._m_Timeout); this._m_Timeout = new Coveo.CNL.Web.Scripts.Timeout(Delegate.create(this, this._fireRealHandler), this._m_Delay); } }, _element_OnMouseOut: function Coveo_CNL_Web_Scripts_OnDwellEvent$_element_OnMouseOut() { if (!this._m_Element.contains(window.event.toElement)) { if (this._m_Timeout != null) { this._m_Timeout.cancel(); this._m_Timeout = null; } } } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.ElementPosition Coveo.CNL.Web.Scripts.ElementPosition = function Coveo_CNL_Web_Scripts_ElementPosition(p_Left, p_Top) { /// /// Holds the position of an element. /// /// /// The left position of the element. /// /// /// The top position of the element. /// /// /// The left position of the element, in pixels. /// /// /// The top position of the element, in pixels. /// this.left = p_Left; this.top = p_Top; } Coveo.CNL.Web.Scripts.ElementPosition.prototype = { left: 0, top: 0 } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.ElementBounds Coveo.CNL.Web.Scripts.ElementBounds = function Coveo_CNL_Web_Scripts_ElementBounds(p_Left, p_Top, p_Right, p_Bottom) { /// /// Holds the bounds of an element. /// /// /// The left position of the element. /// /// /// The top position of the element. /// /// /// The right position of the element. /// /// /// The bottom position of the element. /// /// /// The left position of the element, in pixels. /// /// /// The top position of the element, in pixels. /// /// /// The right position of the element, in pixels. /// /// /// The bottom position of the element, in pixels. /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Left >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Top >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Right >= p_Left); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Bottom >= p_Top); this.left = p_Left; this.top = p_Top; this.right = p_Right; this.bottom = p_Bottom; } Coveo.CNL.Web.Scripts.ElementBounds.prototype = { left: 0, top: 0, right: 0, bottom: 0, get_width: function Coveo_CNL_Web_Scripts_ElementBounds$get_width() { /// /// The width of the element. /// /// return this.right - this.left; }, get_height: function Coveo_CNL_Web_Scripts_ElementBounds$get_height() { /// /// The height of the element. /// /// return this.bottom - this.top; } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.Browser Coveo.CNL.Web.Scripts.Browser = function Coveo_CNL_Web_Scripts_Browser() { /// /// Provides various general javascript utilities. /// } Coveo.CNL.Web.Scripts.Browser.get_isIE = function Coveo_CNL_Web_Scripts_Browser$get_isIE() { /// /// This property is true if the browser is Internet Explorer. /// /// return window.navigator.userAgent.indexOf('MSIE') !== -1; } Coveo.CNL.Web.Scripts.Browser.get_isIE6 = function Coveo_CNL_Web_Scripts_Browser$get_isIE6() { /// /// This property is true if the browser is Internet Explorer 6. /// /// return window.navigator.userAgent.indexOf('MSIE 6') !== -1; } Coveo.CNL.Web.Scripts.Browser.get_isIE7 = function Coveo_CNL_Web_Scripts_Browser$get_isIE7() { /// /// This property is true if the browser is Internet Explorer 7. /// /// return window.navigator.userAgent.indexOf('MSIE 7') !== -1; } Coveo.CNL.Web.Scripts.Browser.get_isIE8 = function Coveo_CNL_Web_Scripts_Browser$get_isIE8() { /// /// This property is true if the browser is Internet Explorer 8. /// /// return window.navigator.userAgent.indexOf('MSIE 8') !== -1; } Coveo.CNL.Web.Scripts.Browser.get_isIE7Plus = function Coveo_CNL_Web_Scripts_Browser$get_isIE7Plus() { /// /// This property is true if the browser is Internet Explorer 7 or better. /// /// return Coveo.CNL.Web.Scripts.Browser.get_isIE7() || Coveo.CNL.Web.Scripts.Browser.get_isIE8(); } Coveo.CNL.Web.Scripts.Browser.get_isIE8Plus = function Coveo_CNL_Web_Scripts_Browser$get_isIE8Plus() { /// /// This property is true if the browser is Internet Explorer 8 or better. /// /// return Coveo.CNL.Web.Scripts.Browser.get_isIE8(); } Coveo.CNL.Web.Scripts.Browser.get_isFirefox = function Coveo_CNL_Web_Scripts_Browser$get_isFirefox() { /// /// This property is true if the browser is Firefox. /// /// return window.navigator.userAgent.indexOf('Firefox') !== -1; } Coveo.CNL.Web.Scripts.Browser.get_standardMode = function Coveo_CNL_Web_Scripts_Browser$get_standardMode() { /// /// This property is true if the current document is in standard mode. /// /// return eval('document.compatMode') !== 'BackCompat'; } Coveo.CNL.Web.Scripts.Browser.get_quirksMode = function Coveo_CNL_Web_Scripts_Browser$get_quirksMode() { /// /// This property is true if the current document is in quirks mode. /// /// return !Coveo.CNL.Web.Scripts.Browser.get_standardMode(); } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.ElementSize Coveo.CNL.Web.Scripts.ElementSize = function Coveo_CNL_Web_Scripts_ElementSize(p_Width, p_Height) { /// /// Holds the size of an element. /// /// /// The width of the element. /// /// /// The height of the element. /// /// /// The width of the element, in pixels. /// /// /// The heigh of the element, in pixels. /// Coveo.CNL.Web.Scripts.CNLAssert.check(p_Width >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Height >= 0); this.width = p_Width; this.height = p_Height; } Coveo.CNL.Web.Scripts.ElementSize.prototype = { width: 0, height: 0 } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.DOMUtilities Coveo.CNL.Web.Scripts.DOMUtilities = function Coveo_CNL_Web_Scripts_DOMUtilities() { /// /// Provides various utilities for marshalling data with the server. /// /// /// /// /// } Coveo.CNL.Web.Scripts.DOMUtilities.getWindowSize = function Coveo_CNL_Web_Scripts_DOMUtilities$getWindowSize() { /// /// Computes the size of the display window, in pixels. /// /// var size; if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { size = new Coveo.CNL.Web.Scripts.ElementSize(document.documentElement.clientWidth, document.documentElement.clientHeight); } else { size = new Coveo.CNL.Web.Scripts.ElementSize(document.body.clientWidth, document.body.clientHeight); } return size; } Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount = function Coveo_CNL_Web_Scripts_DOMUtilities$getScrollingAmount() { /// /// Computes the current scrolling amount of the window. /// /// var x, y; if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop; } else { x = document.body.scrollLeft; y = document.body.scrollTop; } return new Coveo.CNL.Web.Scripts.ElementSize(x, y); } Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementPosition(p_Element) { /// /// Computes the position of an element, in pixels, relative to the top of the document. /// /// /// The element whose position to compute. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); var left = 0; var top = 0; if (Coveo.CNL.Web.Scripts.Browser.get_isIE() && !Coveo.CNL.Web.Scripts.Browser.get_isIE8Plus()) { var rects = p_Element.getClientRects(); var rect = rects.item(0); left = rect.left; top = rect.top; if (String.compare(p_Element.tagName, 'html', true) !== 0 && String.compare(p_Element.tagName, 'body', true) !== 0) { var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); left += scroll.width; top += scroll.height; } left -= 2; top -= 2; } else if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { var elem = p_Element; while (elem != null) { left += elem.offsetLeft - elem.scrollLeft; top += elem.offsetTop - elem.scrollTop; if (elem.style.position === 'fixed') { var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); left += scroll.width; top += scroll.height; break; } elem = elem.offsetParent; } } else { var elem = p_Element; while (String.compare(elem.tagName, 'body', true) !== 0) { left += elem.offsetLeft - elem.scrollLeft; top += elem.offsetTop - elem.scrollTop; if (elem.style.position === 'fixed') { var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); left += scroll.width; top += scroll.height; break; } elem = elem.offsetParent; } } return new Coveo.CNL.Web.Scripts.ElementPosition(left, top); } Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementSize(p_Element) { /// /// Computes the size of an element, in pixels. /// /// /// The element whose size to compute. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); return new Coveo.CNL.Web.Scripts.ElementSize(p_Element.offsetWidth, p_Element.offsetHeight); } Coveo.CNL.Web.Scripts.DOMUtilities.setElementSize = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementSize(p_Element, p_Size) { /// /// Sets the size of an element. /// /// /// The element whose size to set. /// /// /// The new size of the element. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Size); p_Element.style.width = p_Size.width + 'px'; p_Element.style.height = p_Size.height + 'px'; } Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds = function Coveo_CNL_Web_Scripts_DOMUtilities$getElementBounds(p_Element) { /// /// Computes the bounds of an element, in pixels. /// /// /// The element whose bounds to compute. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); var pos = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(p_Element); var size = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Element); return new Coveo.CNL.Web.Scripts.ElementBounds(pos.left, pos.top, pos.left + size.width, pos.top + size.height); } Coveo.CNL.Web.Scripts.DOMUtilities.setElementBounds = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementBounds(p_Element, p_Bounds) { /// /// Sets the bounds of an absolutely positioned element. /// /// /// The element whose bounds to set. /// /// /// The new bounds of the element. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Bounds); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Element.style.position === 'absolute'); p_Element.style.left = p_Bounds.left + 'px'; p_Element.style.top = p_Bounds.top + 'px'; p_Element.style.width = p_Bounds.get_width() + 'px'; p_Element.style.height = p_Bounds.get_height() + 'px'; } Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle = function Coveo_CNL_Web_Scripts_DOMUtilities$getVisibleRectangle() { /// /// Retrieves the bounding of the region that is visible in the window (in pixels). /// /// var left, top; var scroll = Coveo.CNL.Web.Scripts.DOMUtilities.getScrollingAmount(); left = scroll.width; top = scroll.height; var right, bottom; if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { right = left + document.documentElement.clientWidth; bottom = top + document.documentElement.clientHeight; } else { right = left + document.body.clientWidth; bottom = top + document.body.clientHeight; } return new Coveo.CNL.Web.Scripts.ElementBounds(left, top, right, bottom); } Coveo.CNL.Web.Scripts.DOMUtilities.getIntersection = function Coveo_CNL_Web_Scripts_DOMUtilities$getIntersection(p_First, p_Second) { /// /// Computes the intersection of two rectangles. /// /// /// The first rectangle. /// /// /// The first rectangle. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_First); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Second); var left = Math.max(p_First.left, p_Second.left); var top = Math.max(p_First.top, p_Second.top); var right = Math.min(p_First.right, p_Second.right); var bottom = Math.min(p_First.bottom, p_Second.bottom); return new Coveo.CNL.Web.Scripts.ElementBounds(left, top, right, bottom); } Coveo.CNL.Web.Scripts.DOMUtilities.positionElement = function Coveo_CNL_Web_Scripts_DOMUtilities$positionElement(p_Element, p_Reference, p_Position) { /// /// Positions an element relative to another. /// /// /// The to position. /// /// /// The to position relatively to. /// /// /// Where to place the element from the other. /// var position1; var position2; switch (p_Position) { case Coveo.CNL.Web.Scripts.PositionEnum.leftBelow: position1 = 'Left'; position2 = 'Below'; break; case Coveo.CNL.Web.Scripts.PositionEnum.leftAbove: position1 = 'Left'; position2 = 'Above'; break; case Coveo.CNL.Web.Scripts.PositionEnum.aboveLeft: position1 = 'Above'; position2 = 'Left'; break; case Coveo.CNL.Web.Scripts.PositionEnum.aboveRight: position1 = 'Above'; position2 = 'Right'; break; case Coveo.CNL.Web.Scripts.PositionEnum.rightBelow: position1 = 'Right'; position2 = 'Below'; break; case Coveo.CNL.Web.Scripts.PositionEnum.rightAbove: position1 = 'Right'; position2 = 'Above'; break; case Coveo.CNL.Web.Scripts.PositionEnum.belowLeft: position1 = 'Below'; position2 = 'Left'; break; case Coveo.CNL.Web.Scripts.PositionEnum.belowRight: position1 = 'Below'; position2 = 'Right'; break; default: Coveo.CNL.Web.Scripts.CNLAssert.fail(); position1 = 'Left'; position2 = 'Below'; break; } var left = 0; var top = 0; var reqLeft = 0; var reqTop = 0; var done = false; var attempts = 0; var osize = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Element); var rrect = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(p_Reference); var vrect = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle(); while (!done && attempts < 3) { if (position1 === 'Left') { left = rrect.left - osize.width; } else if (position1 === 'Right') { left = rrect.right - 1; } else if (position1 === 'Above') { top = rrect.top - osize.height; } else if (position1 === 'Below') { top = rrect.bottom - 1; } if (position2 === 'Left') { left = rrect.left; } else if (position2 === 'Right') { left = rrect.right - osize.width; } else if (position2 === 'Above') { top = rrect.bottom - osize.height; } else if (position2 === 'Below') { top = rrect.top; } if (attempts === 0) { reqLeft = left; reqTop = top; } done = true; var right = left + osize.width; var bottom = top + osize.height; if (left < vrect.left || right >= vrect.right) { if (position1 === 'Left') { position1 = 'Right'; } else if (position1 === 'Right') { position1 = 'Left'; } else if (position2 === 'Left') { position2 = 'Right'; } else if (position2 === 'Right') { position2 = 'Left'; } done = false; } if (top < vrect.top || bottom >= vrect.bottom) { if (position1 === 'Above') { position1 = 'Below'; } else if (position1 === 'Below') { position1 = 'Above'; } else if (position2 === 'Above') { position2 = 'Below'; } else if (position2 === 'Below') { position2 = 'Above'; } done = false; } ++attempts; } if (!done) { left = reqLeft; top = reqTop; } Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition(p_Element, new Coveo.CNL.Web.Scripts.ElementPosition(left, top)); } Coveo.CNL.Web.Scripts.DOMUtilities.setElementPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$setElementPosition(p_Element, p_Position) { /// /// Sets the position of an element. /// /// /// The to position. /// /// /// The position where to place the element. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Position); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Element.currentStyle.position === 'absolute'); var offsetParent = p_Element.offsetParent; if (offsetParent != null) { var position = Coveo.CNL.Web.Scripts.DOMUtilities.getElementPosition(offsetParent); p_Element.style.left = p_Position.left - position.left + 'px'; p_Element.style.top = p_Position.top - position.top + 'px'; } else { p_Element.style.left = p_Position.left + 'px'; p_Element.style.top = p_Position.top + 'px'; } } Coveo.CNL.Web.Scripts.DOMUtilities.setFixedPosition = function Coveo_CNL_Web_Scripts_DOMUtilities$setFixedPosition(p_Element, p_Left, p_Top) { /// /// Configures an element so that it uses fixed positioning, even on IE6. /// /// /// The element to configure. /// /// /// The fixed left position of the element. /// /// /// The fixed top position of the element. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Left >= 0); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Top >= 0); if ((Coveo.CNL.Web.Scripts.Browser.get_isIE7Plus() && Coveo.CNL.Web.Scripts.Browser.get_standardMode()) || !Coveo.CNL.Web.Scripts.Browser.get_isIE()) { p_Element.style.position = 'fixed'; p_Element.style.left = p_Left + 'px'; p_Element.style.top = p_Top + 'px'; } else { var doc = (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) ? 'documentElement' : 'body'; p_Element.style.position = 'absolute'; p_Element.style.setExpression('left', '(dummy = document.' + doc + '.scrollLeft + ' + p_Left + ') + \'px\''); p_Element.style.setExpression('top', '(dummy = document.' + doc + '.scrollTop + ' + p_Top + ') + \'px\''); } } Coveo.CNL.Web.Scripts.DOMUtilities.consumeRemainingHeight = function Coveo_CNL_Web_Scripts_DOMUtilities$consumeRemainingHeight(p_Parent, p_Header, p_Body, p_Footer, p_Continuous) { /// /// Arranges for a to consume the remaining height /// left by a header and a footer inside a parent. /// /// /// The for the parent. /// /// /// The for the header. /// /// /// The for the body. /// /// /// The for the footer. /// /// /// Whether to continuously update the height. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Parent); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Body); Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, 0, 0, 0, p_Continuous); } Coveo.CNL.Web.Scripts.DOMUtilities.coverAllWindow = function Coveo_CNL_Web_Scripts_DOMUtilities$coverAllWindow(p_Element) { /// /// Configures an element so that it covers all the screen. /// /// /// The element to configure. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.DOMUtilities.setFixedPosition(p_Element, 0, 0); if (Coveo.CNL.Web.Scripts.Browser.get_isIE() && !Coveo.CNL.Web.Scripts.Browser.get_isIE8Plus()) { var doc = (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) ? 'documentElement' : 'body'; p_Element.style.setExpression('width', '(dummy = window.document.' + doc + '.clientWidth) + \'px\''); p_Element.style.setExpression('height', '(dummy = window.document.' + doc + '.clientHeight) + \'px\''); } else { p_Element.style.width = '100%'; p_Element.style.height = '100%'; } } Coveo.CNL.Web.Scripts.DOMUtilities.setOpacity = function Coveo_CNL_Web_Scripts_DOMUtilities$setOpacity(p_Element, p_Opacity) { /// /// Sets the opacity of an element in a cross browser way. /// /// /// The element whose opacity to set. /// /// /// The opacity of the element (from 0 to 1). /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); Coveo.CNL.Web.Scripts.CNLAssert.check(p_Opacity >= 0 && p_Opacity <= 1); if (Math.abs(p_Opacity - 1) > 0.1) { if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { p_Element.style.filter = 'alpha(opacity=' + Math.truncate((p_Opacity * 100)) + ')'; } else { p_Element.style.opacity = p_Opacity.toString(); } } else { if (Coveo.CNL.Web.Scripts.Browser.get_isIE()) { p_Element.style.filter = ''; } else { p_Element.style.opacity = ''; } } } Coveo.CNL.Web.Scripts.DOMUtilities.scrollAllTheWayUp = function Coveo_CNL_Web_Scripts_DOMUtilities$scrollAllTheWayUp() { /// /// Scrolls the browser window all the way up. /// if (Coveo.CNL.Web.Scripts.Browser.get_standardMode()) { document.documentElement.scrollTop = 0; } else { document.body.scrollTop = 0; } } Coveo.CNL.Web.Scripts.DOMUtilities.scrollIntoViewIfNotAlready = function Coveo_CNL_Web_Scripts_DOMUtilities$scrollIntoViewIfNotAlready(p_Element) { /// /// Scrolls an element into view if it's not already being displayed. /// /// /// The to scroll into view. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Element); var visible = Coveo.CNL.Web.Scripts.DOMUtilities.getVisibleRectangle(); var bounds = Coveo.CNL.Web.Scripts.DOMUtilities.getElementBounds(p_Element); if (visible.left > bounds.left || visible.top > bounds.top || visible.right < bounds.right || visible.bottom < bounds.bottom) { p_Element.scrollIntoView(); } } Coveo.CNL.Web.Scripts.DOMUtilities.resizeIFrameHeight = function Coveo_CNL_Web_Scripts_DOMUtilities$resizeIFrameHeight(p_IFrame, p_AdditionalHeight) { /// /// Resizes an iframe to it's content height. /// /// /// The iframe to resize. /// /// /// Additional height to provide for. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_IFrame); var height; if (String.compare(p_IFrame.contentWindow.document.compatMode, 'BackCompat', true) !== 0) { height = p_IFrame.contentWindow.document.documentElement.scrollHeight; } else { height = p_IFrame.contentWindow.document.body.scrollHeight; } p_IFrame.style.height = (height + p_AdditionalHeight) + 'px'; } Coveo.CNL.Web.Scripts.DOMUtilities.removeLinkAndStylesheet = function Coveo_CNL_Web_Scripts_DOMUtilities$removeLinkAndStylesheet(p_Link) { /// /// Removes a link element from the DOM, and removes it's associated stylesheet as well. /// /// /// The link element to remove. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Link); var stylesheets = window.document.styleSheets; for (var i = 0; i < stylesheets.length; ++i) { var stylesheet = stylesheets[i]; var owner = stylesheet[(Coveo.CNL.Web.Scripts.Browser.get_isIE()) ? 'owningElement' : 'ownerNode']; if (owner === p_Link) { stylesheet.disabled = true; break; } } p_Link.parentNode.removeChild(p_Link); } Coveo.CNL.Web.Scripts.DOMUtilities.setOperationPendingCursor = function Coveo_CNL_Web_Scripts_DOMUtilities$setOperationPendingCursor() { /// /// Changes the global mouse cursor to one that signals that an operation is pending. /// document.body.style.cursor = 'progress'; } Coveo.CNL.Web.Scripts.DOMUtilities.removeOperationPendingCursor = function Coveo_CNL_Web_Scripts_DOMUtilities$removeOperationPendingCursor() { /// /// Removes the global mouse cursor set by . /// document.body.style.cursor = ''; } Coveo.CNL.Web.Scripts.DOMUtilities.incrementBusyCounter = function Coveo_CNL_Web_Scripts_DOMUtilities$incrementBusyCounter() { /// /// Increments the counter that registers if the browser is busy. /// if (++Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter === 1) { Coveo.CNL.Web.Scripts.CNLAssert.isNull(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker); Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = document.createElement('div'); Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker.id = 'CoveoBusyMarker'; Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker.style.display = 'none'; document.body.appendChild(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker); } } Coveo.CNL.Web.Scripts.DOMUtilities.decrementBusyCounter = function Coveo_CNL_Web_Scripts_DOMUtilities$decrementBusyCounter() { /// /// Decrements the counter that registers if the browser is busy. /// Coveo.CNL.Web.Scripts.CNLAssert.check(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter > 0); if (--Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter === 0) { Coveo.CNL.Web.Scripts.CNLAssert.notNull(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker); document.body.removeChild(Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker); Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = null; } } Coveo.CNL.Web.Scripts.DOMUtilities.getNextHighestZindex = function Coveo_CNL_Web_Scripts_DOMUtilities$getNextHighestZindex() { /// /// Gets the next highest Z-Index available. /// /// var highestIndex = 0; var currentIndex = 0; var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; ++i) { currentIndex = elements[i].currentStyle.zIndex; if (!isNaN(currentIndex)) { var current = parseInt(currentIndex); if (current < 16777271 && current > highestIndex) { highestIndex = current; } } } return (highestIndex + 1); } Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal = function Coveo_CNL_Web_Scripts_DOMUtilities$_consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, p_PreviousParentHeight, p_PreviousHeaderHeight, p_PreviousFooterHeight, p_Continuous) { /// /// Arranges for a to consume the remaining height /// left by a header and a footer inside a parent. /// /// /// The for the parent. /// /// /// The for the header. /// /// /// The for the body. /// /// /// The for the footer. /// /// /// The previous height of the parent. /// /// /// The previous height of the header. /// /// /// The previous height of the footer. /// /// /// Whether to continuously update the height. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Parent); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Body); if (p_Parent.parentNode != null) { var parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height; var headerHeight = (p_Header != null) ? Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Header).height : 0; var footerHeight = (p_Footer != null) ? Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Footer).height : 0; if (parentHeight !== p_PreviousParentHeight || headerHeight !== p_PreviousHeaderHeight || footerHeight !== p_PreviousFooterHeight) { p_Body.style.height = '25px'; var borderHeight = p_Body.clientTop * 2; p_Body.style.display = 'none'; parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height; p_Body.style.height = Math.max(parentHeight - headerHeight - footerHeight - borderHeight, 0) + 'px'; p_Body.style.display = 'block'; parentHeight = Coveo.CNL.Web.Scripts.DOMUtilities.getElementSize(p_Parent).height; } if (p_Continuous) { window.setTimeout(Delegate.create(null, function() { Coveo.CNL.Web.Scripts.DOMUtilities._consumeRemainingHeightInternal(p_Parent, p_Header, p_Body, p_Footer, parentHeight, headerHeight, footerHeight, p_Continuous); }), 500); } } else { } } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.MarshalUtilities Coveo.CNL.Web.Scripts.MarshalUtilities = function Coveo_CNL_Web_Scripts_MarshalUtilities() { /// /// Provides various utilities for marshalling data with the server. /// } Coveo.CNL.Web.Scripts.MarshalUtilities.marshalValue = function Coveo_CNL_Web_Scripts_MarshalUtilities$marshalValue(p_Value) { /// /// Marshals a value to send it to the server. /// /// /// The value to marshal. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Value); return p_Value.toString(); } Coveo.CNL.Web.Scripts.MarshalUtilities.unmarshalValue = function Coveo_CNL_Web_Scripts_MarshalUtilities$unmarshalValue(p_Type, p_Value) { /// /// Unmarshals a value sent by the server. /// /// /// The type of the value to unmarshall. /// /// /// The string representation of the value. /// /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Type); Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_Value); var value; switch (p_Type.toLowerCase()) { case 'string': value = p_Value; break; case 'int32': value = Number.parse(p_Value); break; case 'double': value = Number.parse(p_Value); break; case 'boolean': value = Boolean.parse(p_Value); break; case 'none': value = null; break; default: Coveo.CNL.Web.Scripts.CNLAssert.fail(); value = null; break; } return value; } //////////////////////////////////////////////////////////////////////////////// // Coveo.CNL.Web.Scripts.CNLAssert Coveo.CNL.Web.Scripts.CNLAssert = function Coveo_CNL_Web_Scripts_CNLAssert() { /// /// Provides various assertions for client code. /// } Coveo.CNL.Web.Scripts.CNLAssert.fail = function Coveo_CNL_Web_Scripts_CNLAssert$fail() { /// /// Call when an assertion fails. /// } Coveo.CNL.Web.Scripts.CNLAssert.failWithMessage = function Coveo_CNL_Web_Scripts_CNLAssert$failWithMessage(p_Message) { /// /// Call when an assertion fails. /// /// /// The message to display with the assert. /// } Coveo.CNL.Web.Scripts.CNLAssert.check = function Coveo_CNL_Web_Scripts_CNLAssert$check(p_Condition) { /// /// Checks that a condition is true. /// /// /// The condition to check. /// if (!p_Condition) { Coveo.CNL.Web.Scripts.CNLAssert.fail(); } } Coveo.CNL.Web.Scripts.CNLAssert.notNull = function Coveo_CNL_Web_Scripts_CNLAssert$notNull(p_Object) { /// /// Asserts that an object is not null. /// /// /// The object to check. /// Coveo.CNL.Web.Scripts.CNLAssert.check(!isNullOrUndefined(p_Object)); } Coveo.CNL.Web.Scripts.CNLAssert.isNull = function Coveo_CNL_Web_Scripts_CNLAssert$isNull(p_Object) { /// /// Asserts that an object is null. /// /// /// The object to check. /// Coveo.CNL.Web.Scripts.CNLAssert.check(isNullOrUndefined(p_Object)); } Coveo.CNL.Web.Scripts.CNLAssert.notEmpty = function Coveo_CNL_Web_Scripts_CNLAssert$notEmpty(p_String) { /// /// Asserts that a string is not null and not empty. /// /// /// The string to check. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String); Coveo.CNL.Web.Scripts.CNLAssert.check(p_String !== ''); } Coveo.CNL.Web.Scripts.CNLAssert.isEmpty = function Coveo_CNL_Web_Scripts_CNLAssert$isEmpty(p_String) { /// /// Asserts that a string is not null and empty. /// /// /// The string to check. /// Coveo.CNL.Web.Scripts.CNLAssert.notNull(p_String); Coveo.CNL.Web.Scripts.CNLAssert.check(p_String === ''); } Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess.createClass('Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess'); Coveo.CNL.Web.Scripts.Ajax.ControlFlipper.createClass('Coveo.CNL.Web.Scripts.Ajax.ControlFlipper', null, Coveo.CNL.Web.Scripts.Ajax.IContentFlipper); Coveo.CNL.Web.Scripts.Ajax.TransitionEffect.createClass('Coveo.CNL.Web.Scripts.Ajax.TransitionEffect', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess); Coveo.CNL.Web.Scripts.Ajax.CollapseTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.CollapseTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.AdjustTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.AdjustTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.Console.createClass('Coveo.CNL.Web.Scripts.Ajax.Console'); Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript.createClass('Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript'); Coveo.CNL.Web.Scripts.Ajax.Feedback.createClass('Coveo.CNL.Web.Scripts.Ajax.Feedback', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess); Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.createClass('Coveo.CNL.Web.Scripts.Ajax.BlankFeedback', Coveo.CNL.Web.Scripts.Ajax.Feedback); Coveo.CNL.Web.Scripts.Ajax.Bootstrap.createClass('Coveo.CNL.Web.Scripts.Ajax.Bootstrap'); Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript.createClass('Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess); Coveo.CNL.Web.Scripts.Ajax.DropDownContentController.createClass('Coveo.CNL.Web.Scripts.Ajax.DropDownContentController', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler.createClass('Coveo.CNL.Web.Scripts.Ajax.DropDownMenuControler', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript.createClass('Coveo.CNL.Web.Scripts.Ajax.PostbackOptionsScript'); Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.createClass('Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack', Coveo.CNL.Web.Scripts.Ajax.Feedback); Coveo.CNL.Web.Scripts.Ajax.Profiler.createClass('Coveo.CNL.Web.Scripts.Ajax.Profiler'); Coveo.CNL.Web.Scripts.Ajax.PercentTimer.createClass('Coveo.CNL.Web.Scripts.Ajax.PercentTimer'); Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger.createClass('Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.IdMappings.createClass('Coveo.CNL.Web.Scripts.Ajax.IdMappings'); Coveo.CNL.Web.Scripts.Ajax.FadeInTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.FadeInTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect.createClass('Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper.createClass('Coveo.CNL.Web.Scripts.Ajax.ScriptLoaderWrapper', Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcess); Coveo.CNL.Web.Scripts.Ajax.ModalBox.createClass('Coveo.CNL.Web.Scripts.Ajax.ModalBox'); Coveo.CNL.Web.Scripts.Ajax.FlipTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.FlipTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager.createClass('Coveo.CNL.Web.Scripts.Ajax.AsynchronousProcessManager'); Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.HExpandTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.HExpandTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.ExpandTransition.createClass('Coveo.CNL.Web.Scripts.Ajax.ExpandTransition', Coveo.CNL.Web.Scripts.Ajax.TransitionEffect); Coveo.CNL.Web.Scripts.Ajax.RegionFlipper.createClass('Coveo.CNL.Web.Scripts.Ajax.RegionFlipper', null, Coveo.CNL.Web.Scripts.Ajax.IContentFlipper); Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.createClass('Coveo.CNL.Web.Scripts.Ajax.PartialPostBack'); Coveo.CNL.Web.Scripts.Ajax._feedbackInfo.createClass('Coveo.CNL.Web.Scripts.Ajax._feedbackInfo'); Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript.createClass('Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript'); Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript.createClass('Coveo.CNL.Web.Scripts.BetterControls.BetterButtonScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript.createClass('Coveo.CNL.Web.Scripts.BetterControls.BetterLinkButtonScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript.createClass('Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.Misc.ToolTipScript.createClass('Coveo.CNL.Web.Scripts.Misc.ToolTipScript', Coveo.CNL.Web.Scripts.Ajax.AjaxObjectScript); Coveo.CNL.Web.Scripts.OnClickElsewhereEvent.createClass('Coveo.CNL.Web.Scripts.OnClickElsewhereEvent'); Coveo.CNL.Web.Scripts.StringDeserializer.createClass('Coveo.CNL.Web.Scripts.StringDeserializer'); Coveo.CNL.Web.Scripts.TransferMargin.createClass('Coveo.CNL.Web.Scripts.TransferMargin'); Coveo.CNL.Web.Scripts.Timeout.createClass('Coveo.CNL.Web.Scripts.Timeout'); Coveo.CNL.Web.Scripts.OnLeaveManyEvent.createClass('Coveo.CNL.Web.Scripts.OnLeaveManyEvent'); Coveo.CNL.Web.Scripts.OnDwellEvent.createClass('Coveo.CNL.Web.Scripts.OnDwellEvent'); Coveo.CNL.Web.Scripts.ElementPosition.createClass('Coveo.CNL.Web.Scripts.ElementPosition'); Coveo.CNL.Web.Scripts.ElementBounds.createClass('Coveo.CNL.Web.Scripts.ElementBounds'); Coveo.CNL.Web.Scripts.Browser.createClass('Coveo.CNL.Web.Scripts.Browser'); Coveo.CNL.Web.Scripts.ElementSize.createClass('Coveo.CNL.Web.Scripts.ElementSize'); Coveo.CNL.Web.Scripts.DOMUtilities.createClass('Coveo.CNL.Web.Scripts.DOMUtilities'); Coveo.CNL.Web.Scripts.MarshalUtilities.createClass('Coveo.CNL.Web.Scripts.MarshalUtilities'); Coveo.CNL.Web.Scripts.CNLAssert.createClass('Coveo.CNL.Web.Scripts.CNLAssert'); Coveo.CNL.Web.Scripts.Ajax.CollapseTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.AdjustTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.Console._s_Console = null; Coveo.CNL.Web.Scripts.Ajax.BlankFeedback.imagE_URI = null; Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Element = null; Coveo.CNL.Web.Scripts.Ajax.Bootstrap._s_Request = null; Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._initiaL_DELAY$1 = 1000; Coveo.CNL.Web.Scripts.Ajax.AjaxProgressScript._polL_DELAY$1 = 500; Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack._framE_DELAY$2 = 750; Coveo.CNL.Web.Scripts.Ajax.ProcessingFeedBack.PROCESSING = null; Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Current = null; Coveo.CNL.Web.Scripts.Ajax.Profiler._s_Results = null; Coveo.CNL.Web.Scripts.Ajax.UpdateDebugger._displaY_DELAY$2 = 3000; Coveo.CNL.Web.Scripts.Ajax.FlipFadeTransition._framE_DELAY$2 = 25; Coveo.CNL.Web.Scripts.Ajax.Feedback._initiaL_DELAY$1 = 25; Coveo.CNL.Web.Scripts.Ajax.FadeInTransition._framE_DELAY$2 = 20; Coveo.CNL.Web.Scripts.Ajax.GradualFadeInEffect._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.FadeFlipTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.HAdjustTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.HCollapseTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.HExpandTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.ExpandTransition._framE_DELAY$2 = 7; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack._s_FirstPartialPostBack = true; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_PARTIAL_POSTBACK = 'Coveo-Partial-Postback'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_BOOTSTRAP = 'Coveo-Bootstrap'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_HISTORY_STATE = 'Coveo-HState'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.headeR_NO_CONTROL_DATA = 'Coveo-No-Control-Data'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_TARGET = '__EVENTTARGET'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_EVENT_ARGUMENT = '__EVENTARGUMENT'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE = '__VIEWSTATE'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_VIEW_STATE_ENCRYPTED = '__VIEWSTATEENCRYPTED'; Coveo.CNL.Web.Scripts.Ajax.PartialPostBack.forM_REQUEST_DIGEST = '__REQUESTDIGEST'; Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_Instance = null; Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._s_InitialHistoryEventArgs = null; if (document.getElementById('_historyFrame') != null) { var app = ScriptFX.Application.current; app.enableHistory(); app.get_history().add_navigated(Delegate.create(null, Coveo.CNL.Web.Scripts.Ajax.AjaxManagerScript._initial_History_Navigated)); } Coveo.CNL.Web.Scripts.Misc.TextChangedEventScript._postbacK_DELAY$1 = 250; Coveo.CNL.Web.Scripts.StringDeserializer.defaulT_SEPARATOR = '!'; Coveo.CNL.Web.Scripts.StringDeserializer.escapE_CHARACTER = '\\'; Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyCounter = 0; Coveo.CNL.Web.Scripts.DOMUtilities._s_BusyMarker = null; // ---- Do not remove this footer ---- // This script was generated using Script# v0.5.5.0 (http://projects.nikhilk.net/ScriptSharp) // -----------------------------------